added docstrings to functions