sort the array using insertion sort