Run astyle over the code.

The Arduino IDE is an awful editor and it encorages awful code. Astyle was invoked with:
preferred bracket style
--style=java

use real tabs
--indent=tab

add spaces around operators
--pad-oper

add brackets to one-line conditionals
--add-brackets

attach reference operator to type
--align-pointer=type