merge method and implementation