add more unit tests, minor docs tweaks