refactor #insertionsort