Add docstring and rename functions.