public synchronized void handle(String userID, int ID, String input) {
		StringTokenizer in = new StringTokenizer(input, " ");
		String command = in.nextToken();
		System.out.println(command);
		if (command.equals(".bye")) {
			clients[findClient(ID)].send(".bye");
			remove(ID);
		} else if (command.equals(".create")) {// .createGroup gID
			String gID = in.nextToken();
			Group g = new Group(gID);
			groups.add(g);
			g.joinGroup(userID);
			getUser(userID).addGroup(gID);
			System.out.println("create");
		} else if (command.equals(".join")) {// .joinGroup gID
			String gID = in.nextToken();
			Group g = getGroup(gID);
			g.joinGroup(userID);
			getUser(userID).addGroup(gID);
			clients[findClient(ID)].setGroupID(gID);
			System.out.println("join");
		} else if (command.equals(".leave")) {
			String gID = in.nextToken();
			Group g = getGroup(gID);
			g.leaveGroup(userID);
			getUser(userID).deleteGroup(gID);
			clients[findClient(ID)].setGroupID("");
			System.out.println("leave");
		} else if (command.equals(".enter")) {
			String gID = in.nextToken();
			Group g = getGroup(gID);
			g.enterGroup(userID);
			clients[findClient(ID)].setGroupID(gID);
			clients[findClient(ID)].send(g.getUnread(userID));
			System.out.println("enter");
		} else if (command.equals(".exit")) {
			String gID = in.nextToken();
			Group g = getGroup(gID);
			g.exitGroup(userID);
			clients[findClient(ID)].setGroupID("");
			System.out.println("exit");
		} else if (command.equals(".login")) {
			String uID = in.nextToken();
			UserInfo loginUser = new UserInfo(uID);
			if (users.contains(loginUser)) {
				String gListString = users.get(users.indexOf(uID))
						.getGroupList().toString();
				clients[findClient(ID)].send(".groupList " + gListString);
			} else {
				users.add(loginUser);
				clients[findClient(ID)].send(".newUser");
			}
			System.out.println("login");
		} else {
			String gID = clients[findClient(ID)].getGroupID();
			ArrayList<String> sendList = getGroup(gID).sendMsg(
					new Message(input, userID, dateFormat.format(time)));

			for (int i = 0; i < sendList.size(); i++)
				clients[findUser(sendList.get(i))].send(ID + ": " + input);
			System.out.println(ID + ": " + input);
		}
	}