Recursive merge