public void clean() {

        // remove transitions with wordProb < epsilon
        Iterator<State> it = Q.iterator();
        while (it.hasNext()) {
            State st = it.next();
            if (st.isUsed()) {
                st.cleanEpsilon(EPSILON, I);
            }
        }

        // remove inaccessible states
        HashSet<State> newQ = new HashSet<State>();
        it = Q.iterator();
        while (it.hasNext()) {
            State st = it.next();

            if (st.isUsed()) {
                newQ.add(st);
            }
        }
        Q.clear();
        Q = null;
        Q = newQ;
        I.repair();
    }