refactored the TestPolynomial