adjusted to handle multi-digit exponents in canonicalpolynomial toString method