refactored chat to its own class and implemented a chatmessage class