Adds comments to the code and cleans it up