@asmeurer : why do we need explicit use of len(f) - 1 instead of function call dup_degree?