optimize the insertion_sort