Minor code reformatting

Adding more spacing, relocating braces, rewrapping comments.