cleanup docstrings and add tests