added function docstrings