various tweaks based on comments on phazel's work

I made tweaks based on the comments I left on your PR, and a few other formatting changes.  Take a look and see what you think.