[B tree] defined the merge function