added derivePolynomial