[solved]Bounds problem...

So I'm being told that I have a bounds problem and I know why, but I can't figure out how to set appropriate bounds. I'm trying to do a steady state temperature distribution, but I'm unsure on how to actually create bounds which work. I know I need one for the center points, one for the boarder points, and one for the corners. Anyone think they could help me with this?

Code:

`int length = 20;`

int width = 20;

double hotplate[] [] = new double[length] [width];

((Each of the hotplate arrays have been filled...))

for (int row = 1; row < length; row++){

for (int column = 1; column < width; column++){

int left = row + 1;

int right = row - 1;

int up = column + 1;

int down = column - 1;

hotplate[row] [column] = ((left + right + up + down)/4);

hotplate[row] [column] = ((hotplate[left] [column] + hotplate[right] [column] +hotplate[row] [up]+hotplate[row] [down])/4);

System.out.print("|"+hotplate[row] [column]+"|");

}

System.out.println("");

}