simple implementation of chatroom tutorial