fixed insertion sort