add comments
Fix declaration after code error
whitespace changes for readability