private void searchAll(int row, int col, String search, BoggleDictionary dict) {
    if(row >= height || row < 0 || col >= width || col < 0) {
        return;
    }
    if(marked[row][col]) {
        return;
    }
    search += letters[row][col];
    
    if(dict.hasWord(search)) {
        set.add(search);
    }
    if(dict.hasPrefix(search)) {
     marked[row][col] = true;
     for (int r = -1; r <= 1; r++) {
        for (int c = -1; c <= 1; c++) {
           searchAll(row + r, col + c, search, dict);
        }
     }
     marked[row][col] = false;
    }
  }