modify the merge function