all tests passing. need to refactor.