updated insertionsort