better insert sort algorithm with unittest