write docs, with doctests.
docs