@Override
    public String toString(){
        if(polynomial == null || polynomial.isEmpty())
            return "0";
        String out = "";
        ListIterator lIt = polynomial.listIterator();
        int index = -1;
        while(lIt.hasNext()){
            index++;
            out += ((Term)lIt.next()).toString(index);
            if(lIt.hasNext()){
                Term next = (Term)lIt.next();
                if(next.factor >= 0)
                    out += " + ";
                if(next.factor < 0)
                    out += " - ";
                lIt.previous();
            }
        }
        return out;
    }