finish insert sort algorithm