tests and docstrings