public static XElement getShortestFeedback(XElement regex, XElement xAlphabet, XElement representative, XElement attemptShortest, XElement maxGrade)
        {
            int           maxG    = int.Parse(maxGrade.Value);
            CharSetSolver solver  = new CharSetSolver(BitWidth.BV64);
            var           dfaPair = DFAUtilities.parseRegexFromXML(regex, xAlphabet, solver);
            var           dfa     = dfaPair.Second.Minimize(solver);

            string representativeString = (XElement.Parse(DFAUtilities.RemoveAllNamespaces(representative.ToString()))).Value.Trim();

            representativeString = representativeString.decodeEpsilon();
            string attemptShortestString = (XElement.Parse(DFAUtilities.RemoveAllNamespaces(attemptShortest.ToString()))).Value.Trim();

            attemptShortestString = attemptShortestString.decodeEpsilon();

            int representativeState  = DFAUtilities.GetStateAfterString(dfa.InitialState, representativeString, dfa, solver);
            int attemptShortestState = DFAUtilities.GetStateAfterString(dfa.InitialState, attemptShortestString, dfa, solver);

            xAlphabet = XElement.Parse(DFAUtilities.RemoveAllNamespaces(xAlphabet.ToString()));
            HashSet <char> alphabet = parseAlphabet(xAlphabet);

            string correctShortest = DFAUtilities.GetRepresentative(representativeState, dfa, alphabet, solver);

            if (correctShortest.Equals(attemptShortestString))
            {
                return(XElement.Parse(string.Format("<div><grade>{0}</grade><feedback>Correct!</feedback></div>", maxG)));
            }
            else if (attemptShortestState == representativeState)
            {
                if (representativeString.Equals(attemptShortestString))
                {
                    return(XElement.Parse(string.Format("<div><grade>{0}</grade><feedback>Please provide a different word than the given one</feedback></div>", 0)));
                }
                else if (attemptShortestString.Length > correctShortest.Length)
                {
                    return(XElement.Parse(string.Format("<div><grade>{0}</grade><feedback>The word '{1}' is in the same equivalence class as '{2}' but there exists a shorter one</feedback></div>", (int)(maxG * 2 / 3), attemptShortestString.emptyToEpsilon(), representativeString.emptyToEpsilon())));
                }
                else
                {
                    return(XElement.Parse(string.Format("<div><grade>{0}</grade><feedback>The word '{1}' is in the same equivalence class as '{2}' but there exists a <strong>lexicographically smaller</strong> one</feedback></div>", (int)(maxG * 4 / 5), attemptShortestString.emptyToEpsilon(), representativeString.emptyToEpsilon())));
                }
            }
            else
            {
                string feedString = "Incorrect!";//"The Correct Answer is '" + correctShortest + "'";
                return(XElement.Parse(string.Format("<div><grade>{0}</grade><feedback>{1}</feedback></div>", 0, feedString)));
            }
        }