more unit tests and documentation