public synchronized void shutdown(String data, String errmsg) { // synchronized???
    try {
      String log;
      StringTokenizer ST = new StringTokenizer(data);
      String name = ST.nextToken();
      int player = Integer.parseInt(ST.nextToken());
      int gameID = Integer.parseInt(ST.nextToken());

      for (int i = 0; i < games.size(); i++) {
        Game game = (Game) games.elementAt(i);

        if (game.getNameOfTheGame().equals(name) && gameID == game.getGameID()) {
          game.shutdown(player, errmsg);

          if (game.getPlayers().size() == 0) {
            games.removeElementAt(i);
            System.out.println("server: game removed");
          }
        }
      }

      log = "server: shutting down player " + player + " in Game " + name + " ID:" + gameID + "\n";
      System.out.print(log);
      log(log, port);
    } catch (NoSuchElementException e) {
      String log = "server: corrupt message in method shutdown\n";
      System.out.print(log);
      log(log, port);
    }
  }