Styleguide conformance

Mostly changed spacing for things, refactored the code a bit, etc. Make sure it compiles and runs properly for you!