improved tests, added unit_tests