Add docstrings for various functions