Solving merge problem