   state.surge_lo ^= Wire.read();
 
   Wire.beginTransmission(ESC_BOARD[2]);
-  Wire.write(valid(cmd.pwm.sway_fwd >> 8));
+  Wire.write(valid(cmd.pwm.sway_fwd) >> 8);
   Wire.write(valid(cmd.pwm.sway_fwd));
-  Wire.write(valid(cmd.pwm.sway_aft >> 8));
+  Wire.write(valid(cmd.pwm.sway_aft) >> 8);
   Wire.write(valid(cmd.pwm.sway_aft));
   Wire.endTransmission();
 

  state.sway ^= Wire.read();

  Wire.beginTransmission(ESC_BOARD[3]);
  Wire.write(valid(cmd.pwm.heave_port_fwd >> 8));
  Wire.write(valid(cmd.pwm.heave_port_fwd));
  Wire.write(valid(cmd.pwm.heave_stbd_fwd >> 8));
  Wire.write(valid(cmd.pwm.heave_stbd_fwd));
  Wire.endTransmission();


  state.surge_hi ^= Wire.read();

  Wire.beginTransmission(ESC_BOARD[1]);
  Wire.write(valid(cmd.pwm.surge_port_lo) >> 8);
  Wire.write(valid(cmd.pwm.surge_port_lo));
  Wire.write(valid(cmd.pwm.surge_stbd_lo) >> 8);
  Wire.write(valid(cmd.pwm.surge_stbd_lo));
  Wire.endTransmission();

