hopefully working write function in communicator