updated recursive-merge