added comments to the main operation