Added docstrings to helper functions.