Added docs, tests, docstrings