Improved code style

Compared the code I'd typed out, with the examples posted by Armin.
Wept, took a deep breath and fixed up my code a bit.