add tests and code coverage