added comments to first code