public State nextStateTraining(String tag) {

        State next = null;
        State st = null;

        int numTrans = 0;
        int otherTrans = 0;
        int totalTrans = 0;
        double ratio = 0;

        current.addTransition(tag);
        next = current.next(tag);

        // transitions from current state given a tag
        numTrans = current.getTransitions(tag);

        // total transitions from current state
        totalTrans = next.getAllTransitions();

        otherTrans = totalTrans - numTrans;

        // split current state if numTrans is greater than limit
        // and otherTrans is also greater than limit
        if ((numTrans > condition1) && (otherTrans > condition2)) {

            st = new State(next.getCloneName());

            // overwrite connection with tag to new state
            current.addConnection(tag, st, true);

            // propagate all connection
            st.addMasterConnection(next.getMasterConnection().getTo());
            for (Connection cn : next.allConnections()) {
                st.addConnection(cn.getTag(), cn.getTo());
            }

            // split next state transition counter to new state
            ratio = (double) (((double) numTrans) / ((double) totalTrans));
            st.copyCounters(next, ratio);
            estats.add(st);
            hashstats.put(st.getName(), st);

            // next state is now the new one
            next = st;
        }

        if(this.backoff && !current.hasConnection(tag))
            next = current.next(tag).next(tag);
        return next;
    }