edited comments to include requirements of the function