Cleaned up for easier reading.

Code is still broken, well aware. However I hope readability has
improved in order to mutually correct the last few bits.
I'm entering theoretical programming here so i'm bailing out :)