test merging function