Add docstrings to helper functions