public double apply(double x){
        double value = 0;
        ListIterator lIt = polynomial.listIterator();
        while(lIt.hasNext()){
            Term t = (Term)lIt.next();
            value += t.factor * Math.pow(x, t.power);
        }
        return value;
    }