Change formatting for clarity.

Also remove trailing whitespace from lines.
Simplify code.

Remove an unnecessary variable. Add some extra blank lines for readability
purposes.