fix insertionSort implementation