optimized insertion sort according to CLRS