completed insertion sort.