Created merging function in SortCommon, also overloaded