added comments to be helpful