added docstrings to all the functions