public Taxi callTaxi(Person p) {
    if (!isTaxiFree()) {
      return null;
    }

    ArrayList<Taxi> freeTaxis = new ArrayList<Taxi>();
    for(int i = 0; i < taxis.size(); i++)
      if(taxis.get(i).isIdle()) freeTaxis.add(taxis.get(i));

    Taxi closestTaxi = freeTaxis.get(0);
    for (int i = 1; i < freeTaxis.size(); i++) {
      if (p.getLocation().distance(freeTaxis.get(i).getLocation()) < closestTaxi.getLocation().distance(p.getLocation())) {
        closestTaxi = freeTaxis.get(i);
      }
    }

    closestTaxi.collectPerson(p);
    return closestTaxi;
  }