def update(pos, dims, orig_dims):
    """ Finds neg number in dims and restores it to the value in
    original-dims and subtracts one from the number after it
    e.g (0 -1 0) (0 1 0)-> (0 1 -1) """
    ret_dim = []
    for i, dim in enumerate(dims):
        if pos == i:
            ret_dim.insert(i, orig_dims[i])
        else:
            ret_dim.insert(i, dim)
    ret_dim[pos+1] = dims[pos+1] - 1
    return tuple(ret_dim)