added unit tests and unit test coverage