added comments to functions