public String addUser(String message, String oldname, Socket socket){
	name = message.substring(6);
	//Checks if the name is already in use
	if(users.containsKey(name) || regnames.containsKey(name)){
	    try{
		//Notify the user that name is in use
		DataOutputStream dout = new DataOutputStream(socket.getOutputStream());
		dout.writeUTF("The name " + name + " is already in use or registered. Please choose a different name.");
	    } catch(IOException ie) {
		System.out.println(ie);
	    }
	    return oldname;
	}
	//Checks if the user is using an illegal name
	else if(name.startsWith("nick") || name.contains(" ")){
	    try{
		//Notify user of banned names
		DataOutputStream dout = new DataOutputStream(socket.getOutputStream());
                dout.writeUTF("You cannot use other names starting with nick or names with spaces, please choose another name.");
	    } catch(IOException ie) {
		System.out.println(ie);
	    }
	    return oldname;
	}
	//Assigns the user the name they chose
	else if(!users.containsKey(name) && !regnames.containsKey(name)){
	    users.remove(oldname);
	    ArrayList<String> hold = userroomlist.get(oldname);

	    //Updates the name in lists
	    userroomlist.remove(oldname);
	    userroomlist.put(name, hold);
	    users.put(name, name);

	    //Notifies all rooms the user is in that their name has changed
	    for(int j = 0; j < hold.size(); j++){
		int roomnum = roomlist.get(hold.get(j));
		(rooms.get(roomnum-1)).remove(oldname);
		(rooms.get(roomnum-1)).put(name, outputStreams.get(socket));
		sendToChannel(oldname + " has changed their name to " + name, roomnum, name, socket, hold.get(j));
		sendListChannel(roomnum, name, socket, hold.get(j));
	    }
	    sendToAll(oldname + " has changed their name to " + name);
	    sendListAll();
	    return name;
	}
	return oldname;
    }