Copying code into a file isn't 'coding'. And it took a lot more than 5 minutes to work all this out.
My intentions were that you could read the article in 5 minutes and the code sample would give you a good starting point to code your own implementation.