Added docstrings, updated documentation.