private String tryNewUser(List<String> tokens) {
        if (user != null) {  // if user is already defined
            return error("You have already registered as " + user.name);
        } else if (tokens.size() == 2 && isValidUsername(tokens.get(1))) {
            if (!ServerMain.userIsRegistered(tokens.get(1))) {  // make sure the user doesnt already exist
                user = new User(tokens.get(1), socket.getInetAddress());    // create the user and store it in the list
                ServerMain.addUser(user);
                return ok();
            } else {
                return error(tokens.get(1) + " already used.");
            }
        } else { // if no name was given or it contained space characters
            return error("Invalid Username" + tokens);
        }
    }