for (int i = 0; i < node.ways; i++) {
for (int i = node.ways - 1; i >= 0; i--) {
    private FlatNode whoShouldFire(FlatNode current, HashMap executionCounts, 				    SimulationCounter counters)     {	FlatNode start = current;	//breadth first search from bottom	if (start == null)	    start = toplevel;	HashSet visited = new HashSet();	Vector queue = new Vector();	FlatNode node;	FlatNode mostDownStream = null;				//System.out.println("Starting from " + Namer.getName(start.contents));		queue.add(start);	while (!queue.isEmpty()) {	    node = (FlatNode)queue.get(0);	    visited.add(node);	    if (canFire(node, executionCounts, counters)) {		mostDownStream = node;	    }	    queue.remove(0);	    for (int i = 0; i < node.ways; i++) {		if (!visited.contains(node.edges[i]))			queue.add(node.edges[i]);	    }	}	//no node can fire	if (mostDownStream == current)	    return null;	return mostDownStream;    }