solved insertion sort