converted sending code to new binary message format