public void reactTo(Critter other)
  {
    if(other == null)
    {
      return;
    }
    double distance = 0.0;
    Location tempLoc = new Location(getLocation());
    Location newLoc = tempLoc;

    //for loops to determine furthest distance
    for(int x = -1; x < 2; x++)
    {

      for(int y = -1; y < 2; y++)
      {
        //move the location to test it
        tempLoc.translate(x,y);
        tempDistance = other.getLocation().distanceTo(tempLoc);

        if(tempDistance > distance)
        {
          // current best distance becomes the new
          distance = tempDistance; 
          newLoc = new Location(tempLoc);

        }
        //move location back to the starting point
        tempLoc.translate(-x,-y);
      }

    }
    //test for out of bounds
    if(newLoc.getX() > 0 && newLoc.getX()+rectLength < aCanvas.getWidth() 
        && newLoc.getY() > 0 
        && newLoc.getY()+rectLength < aCanvas.getHeight() )
    {
      this.setLocation(newLoc.getX(), newLoc.getY());
      rect.moveTo(newLoc.getX()- halfSize, newLoc.getY()- halfSize);
    }
    else
    {
      //generate random number
      RandomIntGenerator ran = new RandomIntGenerator(1,aCanvas.getWidth());
      int x = ran.nextValue();
      int y = ran.nextValue();
      //move locations by random number
      this.setLocation((double)x, (double)y);
      rect.moveTo((double)x, (double)y);

    }     

  }//end reactTo