@Override
   void think(World w)
   {
        /*
         * Needs to be remade: instead make task do an AreWeThereYet() function
         */
   if(  getPathfollow().getRunning()==false) //if we are at the end of a scheduled route
    { 
          if(this.getTask()!=null) //if we have to do something
            {
                
             if(this.getTask().isArrived(this, w)) getTask().performTask(w, this);
             else
                 this.cancelJob(w);
              
            } 
   }
   else //if we are still going
   {
   
       if(this.getTask()!=null) //if we have to do something
            {    
             if(this.getTask().isArrived(this, w)) 
             {   
                 
                 
                 
                 getTask().performTask(w, this);
                  return;
             }
             
            }  
       
    int mx = getPathfollow().getnextX();
    int my = getPathfollow().getnextY();
    
     
    if(w.isBlocked(my, mx)==true) //if interrupted by a suddenly appearing wall
    {
         getPathfollow().cancel(); 
         cancelJob(w);
         return;
    } 
        this.setCy(my);
        this.setCx(mx);
        getPathfollow().next(); 
        
     }
   
   
    
            if(getTask()==null)
            w.getTaskmanager().assignTasks(this);
            if(getTask()==null)
            this.randomWander(w);
   
   }