added additional comments to code