private void fill(final char[][] board, final int i, final int j) {

        // pay attention to how i and j are passed in to determine the conditions here
        if (i >= 0 && i < board.length && j >= 0 && j < board[0].length && board[i][j] == 'O') {

            board[i][j] = '#';

            fill(board, i + 1, j);
            fill(board, i - 1, j);
            fill(board, i, j + 1);
            fill(board, i, j - 1);
        }

    }