Commit 5. Final commit before new version.

Commiting before restructuring the algorithm and program as a whole.
Will focus on quality as opposed to efficiency and fancyness. Less and
more readable code is better.