I am writing this article as I am writing the code, so it may look messy, but it reflects how a real life task is completed or screwed by a real life programmer.