Final working implementation of the chat