more unit tests and docs