Cleans up code
Adds comments to the code