implemented getData and applyPolynomial