Updated with tests.