rename function and add docs