Clean up formatting, add comments, and check arguments are closed

+ Clean up formatting of code to be more human-friendly.

+ Add comments to make sure someone can pick this up after me.

+ check arguments are closed (brackets, commas, semi-colons, etc.