switched from recursive canonicalization and coefficients to precomputed canonicalization and multiplication stacks