Some more work, and some doctest/documentation