Add comments to code and formatting