solving merging problems