updated chat room features and organized code