moved unit test to its own module and found bugs.