i have one real quick question about this HiLo game. When I go and test it everything works properly except when I want it to display how many tries it took them to guess. What I'm trying to say is it doesn't count the initial guess, but counts the ones after it so it shows one less guess than what it actually is. Here is my code.

EDIT:I have another quick question. I want the program not to count the guess if it is out of range from 0 to 10. How would i go about doing so because when I run the program it counts the guess as one of my tries.

```js
import java.util.Random;     // Random number generator class
import java.util.Scanner;    // reads user inputs

public class HiLo
{
 public static void main (String[] args)
 {
  //declare variables
  final int MAX = 10;
  int answer, guess;
  int numberOfTries = 0 ;
  String again;

  Scanner Keyboard = new Scanner(System.in);

  do

  {
   System.out.print (" I'm thinking of a number between 0 and "
   + MAX + ". Guess what it is: ");
   guess = Keyboard.nextInt();
   //guess
   Random generator = new Random(); //Random  number generator. 0 to 10.
   answer = generator.nextInt(MAX) +1;

   if (guess > 10)//if guess is bigger than 10 then error message
   {
   System.out.println ("ERROR – Your guess is out of the range 0 to 10.");
   }
   if (guess < 0)//if guess is smaller than 0 then error message
   {
      System.out.println ("ERROR – Your guess is out of the range 0 to 10.");
   }

   while (guess != answer )//If guess is not the answer
   {

   if (guess > answer )//If guess is more than the answer
   {
   System.out.println ("You guessed too high! \nTry again:");
   guess = Keyboard.nextInt();
   }

   if (guess < answer )//If guess is less than the answer
   {
   System.out.println ("Too Low! \nTry again:");
   guess = Keyboard.nextInt();
   }

   numberOfTries=numberOfTries+1;

   }//end of the loop

   // display result
   if ( guess == answer)
   {
   numberOfTries += 1;
   System.out.println ("YOU WIN!");
   System.out.println("It took you " + numberOfTries + " tries!") ;
   System.out.println();
   System.out.print( "Do you want to play again(Y/N)?");
   }

   Keyboard.nextLine(); // skip over enter key
   again = Keyboard.nextLine();

   numberOfTries=0;

  }while (again.equalsIgnoreCase ("Y") );

 } // end of class

} //end of main
```

Thank you!