reordered insertionSort