now with unit tests.