public void breadthFirst(int bfi) {
        
        for(int i=0; i<500; i=i+20) {
            for(int j=0; j<500; j=j+20) {
                
                if(grid[i/20][j/20].path_no == bfi) {
                    
                    for(int k=0; k<grid[i/20][j/20].neighbors.size(); ++k) {

                       if((grid[i/20][j/20].neighbors.get(k).path_no == 0) && grid[i/20][j/20].free) {

                           grid[i/20][j/20].neighbors.get(k).path_no = grid[i/20][j/20].path_no + 1;
                           
                           if((i/20 == goal_row) && (j/20 == goal_col)) {
                               target_found = true;
                               goal_row = i/20;
                               goal_col = j/20;
                           }
                       }
                   }                   
                }
            }
        }
    }