untested code for sending commands