created a merge method