@asmeurer why do we have an additional condition b.degree() >= b.degree() in the original code snippet