more documentation and docstrings