added comments to all code