add new merge function