more docstrings and tests