add merge function.