Add more docs and doctest