public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        Random rand = new Random();
        try {
            do {
                int secret = randomRange(rand, 1, 100);
                boolean success = false;
                do {
                    int guess = getGuess(scan, 1, 100);
                    if (guess == secret) {
                        System.out.print("CORRECT! You guessed the secret number. ");
                        success = true;
                    } else if (guess < secret) {
                        System.out.println("Your guess is too low, please try again.");
                    } else if (guess > secret) {
                        System.out.println("Your guess is too high, please try again.");
                    } else {
                        System.out.println("You broke my program, impressive...");
                    }
                } while (!success);
            } while (keepPlaying(scan));
            System.out.println("Good-bye!");
        } finally {
            scan.close();
        }
    }