You can see the code in my GitHub repo