added unit tests.