OK, I have a small error - it seems that I am getting an infinite recursion on my program that I am trying to solve. So basically, there is an array that you read in, and then taking those values, randomly load them into a 2d array. I have all the set up and other methods done for the program, but my recursion methods seem to be going into infinite recursion. My compiler won't tell me what is wrong with it and i can't see the actual output except for the errors on the recursion statements. I have done similar problems like this before, and this is the first time this error has happened, can someone point me in the right direction?

```
public class Grid
{
    private String[][] grid;
    private int tempCount = 0;

    public Grid()
    {
        grid = new String[10][10];
    }
    public Grid(int rows, int cols, String[] vals)
    {
        setGrid(rows, cols, vals);
    }
    public void setGrid(int rows, int cols, String[] vals)
    {
        grid = new String[rows][cols];
        for(int r = 0; r < grid.length; r++)
            for(int c = 0; c < grid[r].length; c++)
                grid[r][c] = vals[(int)(Math.random() * vals.length)];
    }
    public int findMax(String val)
    {
        int max = 0;
        for(int r = 0; r < grid.length; r++)
        {
            for(int c = 0; c < grid[r].length; c++)
            {
                if(grid[r][c].equals(val))
                {
                    tempCount = 0;
                    int temp = findMaxHelper(r, c, val);
                    if(max < temp)
                        max = temp;
                }
            }
        }
        return max;
    }
    private int findMaxHelper(int r, int c, String search)
    {
        if(r < grid.length && r >= 0 && c < grid[r].length && c >= 0 && grid[r][c].equals(search))
        {
            tempCount++;
            findMaxHelper(r - 1, c, search);
            findMaxHelper(r + 1, c, search);
            findMaxHelper(r, c - 1, search);
            findMaxHelper(r, c + 1, search);
        }
        return tempCount;
    }
    public String toString()
    {
        String output = "";
        for(int r = 0; r < grid.length; r++)
        {
            for(int c = 0; c < grid[r].length; c++)
                output += grid[r][c] + " ";
            output += "\n";
        }
        return output;
    }
}

```