added comments to code