changed output to polynomial sequence