private static Code[][] convertStringArrayToCodeArray2D(String[] strArray) {
        int len = strArray.length;

        // Make histogram of sizes
        int[] codeLengths = new int[64];
        for (int i = 0; i < len; i++) {
            int entryLength = strArray[i].length();
            codeLengths[entryLength]++;
        }

        // Make a 2d array of Code objects, where the first index is for
        //  the length of the Code, and the second index differentiates
        //  between all Code objects with that length
        // In this way, we separate all Code objects by their length,
        //  and can thus reduce the search space
        // In theory, we could then sort each sublist, and do a binary search...
        int largestLength = codeLengths.length - 1;
        while (largestLength > 0 && codeLengths[largestLength] == 0)
            largestLength--;
        Code[][] codeArray = new Code[largestLength + 1][];
        for (int i = 0; i < codeArray.length; i++)
            codeArray[i] = new Code[codeLengths[i]];

        for (int i = 0; i < len; i++) {
            int entryLength = strArray[i].length();
            Code[] entries = codeArray[entryLength];
            for (int j = 0; j < entries.length; j++) {
                if (entries[j] == null) {
                    entries[j] = new Code(strArray[i], i);
                    break;
                }
            }
        }

        return codeArray;
    }