public void selectY() {
        int e = yElm == null ? -1 : sim.locateElm(yElm);
        int firstE = e;
        while (true) {
            for (e++; e < sim.elmListSize(); e++) {
                CircuitElm ce = sim.getElm(e);
                if ((ce instanceof OutputElm || ce instanceof ProbeElm)
                        && ce != elm) {
                    yElm = ce;
                    return;
                }
            }
            if (firstE == -1) {
                return;
            }
            e = firstE = -1;
        }
    }