Added docstrings for all functions