new merge code