Implementing chat program