Creates Merge Sort function