fixed rebasing issues and all tests pass.