private ITrieNode[] getMaxChild(final HashMap<Integer,Integer> frontierMap) {
        // returns two largest weight nodes in order
        HashMap<Character, ITrieNode> availableChildren = getAvailableChildren(frontierMap);
        if (availableChildren == null) {
            return null;
        }
        ITrieNode returnNode = null;
        ITrieNode secondNode = null;

        for (ITrieNode x : this.children.values()) {
            if (
                returnNode == null
                || (
                    frontierMap.containsKey(Integer.valueOf(x.id))
                    && frontierMap.get(Integer.valueOf(x.id)).intValue() > returnNode.getWeight(frontierMap)
                    )
                ) {
                secondNode = returnNode;
                returnNode = x;
            }
        }


        return new ITrieNode[] {returnNode, secondNode};
    }