Added docstrings to each function definition