working insertion sort