Minor code/formatting update

Made some minor improvements to the code, its formatting, and comments.