Restructured the merging function.