added lots of docstrings