protected void addBlocks(Node node, Automaton automaton, Set locatedStates,
			Map i2s, Document document) {
        assert(automaton instanceof TuringMachine); //this code should really be in TMTransducer, but I see why it's here
        if(node == null) return;
		if (!node.hasChildNodes())
			return;
		NodeList allNodes = node.getChildNodes();
		ArrayList blockNodes = new ArrayList();
		for (int k = 0; k < allNodes.getLength(); k++) {
			if (allNodes.item(k).getNodeName().equals(BLOCK_NAME)) {
				blockNodes.add(allNodes.item(k));
			}
		}
		Map i2sn = new java.util.TreeMap(new Comparator() {
			public int compare(Object o1, Object o2) {
				if (o1 instanceof Integer && !(o2 instanceof Integer))
					return -1;
				if (o1 instanceof Integer)
					return ((Integer) o1).intValue()
							- ((Integer) o2).intValue();
				if (o2 instanceof Integer)
					return 1;
				return ((Comparable) o1).compareTo(o2);
			}
		});
		createState(blockNodes, i2sn, automaton, locatedStates, i2s, true,
				document);
		// return i2s;
	}