implemented basic chat functionality