add comments to function