public void processGuess(EventArgs e) {
        JQuery stats = $$(JQuery.class, "stats");
        TextBox guessEntryField = $$(TextBox.class, "guessEntryField");

        int guess;
        try {
            guess = Integer.parseInt(guessEntryField.getValue());
        } catch (NumberFormatException ex) {
            JQuery statusLabel = $(JQuery.class, "#stats .status");
            statusLabel.text("Your guess was not valid.");
            return;
        }


        ++numberOfTries;

        if (guess == randomNumber) {
            replaceWith(new CongratulationForm(numberOfTries));
            return;
        }

        guessEntryField.setValue("");

        String statusText = "";

        if (guess < 1 || guess > 100) {
            statusText = "Your guess, " + guess
                    + " was not between 1 and 100.";
        } else if (guess < randomNumber) {
            if (guess >= lowerBound) {
                lowerBound = guess + 1;
            }
            statusText = "Your guess, " + guess
                    + " was too low.  Try again:";
        } else if (guess > randomNumber) {
            statusText = "Your guess, " + guess
                    + " was too high.  Try again:";
            if (guess <= upperBound) {
                upperBound = guess - 1;
            }
        }

        stats.html(renderFragment("stats", statusText));
    }