finished porting over the chat functionality