Took way longer than i should have...

... i was watching The Walking Dead, and then started to get sleepy.
this was fun!
hope you enjoy, the code is not that bad, it really degraded readability in the last commit, it's getting too late.