insertion sort with test cases