public void sendToChannel(String message, int roomnumber, String currentname, Socket socket, String roomname){
	if((rooms.get(roomnumber-1)).containsKey(currentname) || currentname.startsWith("tempcheck")){
	    synchronized(rooms.get(roomnumber-1)){
		//Get all streams and write to them
		for(Enumeration e = getChannelStreams(roomnumber); e.hasMoreElements(); ){
		    DataOutputStream dout = (DataOutputStream)e.nextElement();
		    
		    try{
			dout.writeUTF(roomname + " " + message);
		    } catch(IOException ie){
			System.out.println(ie);
		    }
		}
	    }
	}
	//Stop users from writing to a channel they are not in
	else{
	    if(message.startsWith("/parted ")){
		message = message.substring(8);
		synchronized(rooms.get(roomnumber-1)){
		    //Get all streams and write to them        
		    for(Enumeration e = getChannelStreams(roomnumber); e.hasMoreElements(); ){
			DataOutputStream dout = (DataOutputStream)e.nextElement();
			try{
			    dout.writeUTF(roomname + " " + message);
			} catch(IOException ie){
			    System.out.println(ie);
			}
		    }
		}
	    }
	    else{
		try{
		    DataOutputStream dout2 = new DataOutputStream(socket.getOutputStream());
		    dout2.writeUTF("You are not in the channel you are trying to send a message to. You cannot send a message to a channel you are not in.");
		} catch(IOException ie) {
		    System.out.println(ie);
		}
	    }
	}
    }