public static int neighbors(int[][] board, final int x, final int y) {
		int neighbors = 0;

		for (int i = x - 1; i <= x + 1; i++) {
			if (i >= 0 && i < board.length) {
				for (int j = y - 1; j <= y + 1; j++) {
					if (j >= 0 && j < board[0].length) {
						if (!(i == x && j == y)) {
							neighbors += board[i][j];
						}
					}
				}
			}
		}

		return neighbors;
	}