def _gap_insert_sort(lst, start, gap):
    """Shell sort helper function"""
    for i in range(start + gap, len(lst), gap):
        cur_val = lst[i]
        cur_pos = i
        while cur_pos >= gap and lst[cur_pos - gap] > cur_val:
            lst[cur_pos] = lst[cur_pos - gap]
            cur_pos = cur_pos - gap
        lst[cur_pos] = cur_val
