fix insertion sort optimized version