fixed docstrings, added doctests