moved chat function

chat() is not utilized yet.