This is some code that we have used to build our chatroom