Commenting code

adding comments to the various conditions