public String chooseHeadChild(String parentCategory, Map<String, String> edges, Sentence sentence) throws IDrefNotInSentenceException {
			//smaller is better!
			int bestEdgeQuality = Integer.MAX_VALUE;
			String bestChildRef = null;
			int curEdgeQuality;
			for (Map.Entry<String, String> edge : edges.entrySet()) {
				curEdgeQuality = getHeadRulePriority(parentCategory, edge.getValue(), sentence.getNode(edge.getKey()).getCategory());
				if (bestEdgeQuality > curEdgeQuality) {
					bestEdgeQuality = curEdgeQuality;
					bestChildRef = edge.getKey();
				}
			}
			//TODO: fix this hack!!!
			//if(bestChildRef==null)
			//	return edges.keySet().iterator().next();
			return bestChildRef;
		}