Tidy up some nested cases and add more blank lines and some comments.
Merge pull request #99 from Zariel/small-tidy-up

Tidy up some nested cases and add more blank lines and some comments.