fix formatting and add comments
Merge pull request #633 from dlobo/FormattingFixes

fix formatting and add comments