added input functionality for polynomials