public Deer getClosestDeer(double distance)
  {
    // get the head of the deer linked list
    Deer head = Deer.getHead();
    Deer curr = head;
    Deer closest = null;
    double closestDistance = 0;
    double currDistance = 0;
    
    
    // loop through the linked list looking for the closest deer
    while (curr != null)
    {
      currDistance = curr.getDistance(this.getXPos(),this.getYPos());
      if (currDistance < distance)
      {
        if (closest == null || currDistance < closestDistance)
        {
          closest = curr;
          closestDistance = currDistance;
        }
      }
      curr = curr.getNext();
    }
    return closest;
  }