renamed replace to merge