added unit tests to find errors