inline insertionsort