more unit tests and code