rewrite the chat room by C