After some talks with the wonderful guys at #learnprogramming
I figured how stuff finally works, and as such was able to methodically
restructure my program to be more durable etc...... This version solves
everything from test 1 to test 6.