completed insertion sort