Complete with unit tests.