insertionSort() now no longer causes exception