def process(off, leadVar, leadDeg, deg, pos, result, todoList):
    """Computes an inplace not exactly tensorproduct of the given
    basis functions (only the simplex of the single variable bases,
    as we limit the multi variable polynomials by a given maximum degree).
    """
    for v in range(leadVar):
        l = deg - leadDeg
        k = 1 + deg * v
        for d in range(1, deg - leadDeg + 1):
            l = deg + 1 - leadDeg - d
            result[:, pos:pos + l] = result[:, 1 + off:1 + off + l] * result[:,
                k:k + 1]
            if l > 1 and leadVar > 0:
                todoList.append((pos - 1, v, leadDeg + d))
            pos += l
            k += 1
            l -= 1
    return pos
