fixed last bug, all tests pass.