Rewriting merge. Still a lot of work