private byte getNextVal(int y, int x) throws TriedAllNumbersException
  {
    int i = 0;
    for (; i < triedBoardVals[y][x].length; i++)
    {
      if (triedBoardVals[y][x][i] == NULL_VAL)
        break;
    }
    if (i >= boardWidth)
      throw new TriedAllNumbersException();
    byte c = 0, triedVals[] = new byte[triedBoardVals[y][x].length];
    for (int j = 0; j < triedVals.length; j++)
    {
      triedVals[j] = NULL_VAL;
    }

    java.util.Random r = new java.util.Random();

    try
    {
      do
      {
        do
        {
          triedVals[c] = (byte)(r.nextInt(boardWidth) + 1);
        } while (!setIsOK(triedVals));

        triedBoardVals[y][x][i] = triedVals[c];

        c++;
      } while (!setIsOK(triedBoardVals[y][x]));
      return triedBoardVals[y][x][i];
    }
    catch (ArrayIndexOutOfBoundsException ex)
    {
      throw new TriedAllNumbersException();
    }
  }