modified InsertionSort