Add further documentation and docstrings