Completed insertionsort