Added inline comments to code