updated for two-way communication