Solving Word Problems with Polynomials