finish insertion sort.