insertion sort on an array