Added chat function

No tests done