first implementation of chat