Implement merge method.