added docstrings, and a new test