More tests and docstrings