Added docstrings for all public functions.