anchor.diff:  void main() 
   {
   	WebSocketHandler webSocketHandler = new WebSocketHandler();
  -
  -	HttpServer.bind('0.0.0.0', int.parse(Platform.environment['PORT'])).then((HttpServer server) 
  +	int port = int.parse(Platform.environment['PORT'], onError: (_) => 8080); //Platform.environment['PORT'] is for Heroku, 8080 is for localhost
  +	HttpServer.bind('0.0.0.0', port).then((HttpServer server) 
   	{
   		server.listen((HttpRequest request)
   		{
   			WebSocketTransformer.upgrade(request).then((WebSocket websocket)
   			{
  -     			webSocketHandler.wsHandler(websocket);
  +					webSocketHandler.wsHandler(websocket);
   			});
  -	    });
  +	   });
   			
   		print('${new DateTime.now().toString()} - Serving Chat on ${'0.0.0.0'}:${Platform.environment['PORT']}.');
   	});
  
positive.code: 		{
  			print("message from client: " + message);
  			processMessage(ws, message);
  	    });
  	}
  
  	processMessage(WebSocket ws, String receivedMessage) 
  	{
  		try 
  		{
  			String userName = getUserName(ws);
  			Map map = JSON.decode(receivedMessage);
  			
  			if(map["username"] == null) 
  			{
  				//combine the username with the channel name to keep track of the same user in multiple channels
  				userName = map["message"].substring(9)+"_"+map["channel"];
  				if(users[userName] != null) 
  				{
  			    	users[userName].close();  //  close the previous connection
          		}
      			users[userName] = ws;
  				map["username"] = map["message"].substring(9);
      			map["message"] = ' joined.';
    			}
  			else if(map["statusMessage"] == "changeName")
  			{
  				users[map["username"]] = users[map["newUername"]];
  				users.remove(map["username"]);
  			}
  			
        		sendAll(JSON.encode(map));
  
negative.code:     	}
  	}
  
    	void sendAll(String sendMessage) 
  	{
  	    userSockets.forEach((String username, WebSocket socket) 
  		{
  			if(socket != null)
  				socket.add(sendMessage);
  	    });
    	}
  }
  