added docstrings to helper functions