A harder rebase homework