improvement on InsertionSort, minimizing insertions into array