added docstrings for helper functions