More tests and more docstrings