private boolean register(Network handler, Handshake hs) throws IOException {
        String name = hs.name;
        if (clients.containsKey(name)) {
            // already contains a client with this name
            handler.send(new Message("",
                    "A user with that name already exists. Try again with another username."));
            handler.shutdown();
            return false;
        } else {
            broadcast(new Message("", name + " connected."));
            clients.put(name, handler);
            System.out.println(name + " connected.");
            handler.setToken(name);
            handler.send(new Message("", "Welcome " + name + " to the server. This is the MOTD."));
            return true;
        }
    }