 /****************************************
    Activate/Deactivate wells.
 *****************************************/
-int SelectWellToActive() {
+void SelectWell_ACT() {
   int well = comm.readInt16Arg();
   if (well >= 0 && well <= 5) {
     ActivateWell(well);
-    return well;
-  }
-  return -1;
-}
-
-int SelectWellToDeActive() {
+    comm.sendCmd(kAcknowledge);
+  } else {
+    comm.send(kError,'Invalid Well.')
+  }
+}
+
+void SelectWell_DeACT() {
   int well = comm.readInt16Arg();
   if (well >= 0 && well <= 5) {
     DeActivateWell(well);
-    return well;
-  }
-  return -1;
+    comm.sendCmd(kAcknowledge);
+  } else{
+    comm.sendCmd(kError,'Invalid Well.');
+  }
 }
 
 void ActivateWell(int well) {

    // Check serial input.
    comm.feedinSerialData();
    /**************************************
      Process the wells.
    ***************************************/
    for (int well = 0; well < nWells; well++) {
      WellDetectThrCheck(well);

  kAcknowledge,
  kError,
  kActivateAllWells,
  kSelectWell_ACT,
  kSelectWell_DeACT,
  kToggleLED,
  kLED_ON,
  kLED_OFF,
  kSelectPump_ON,
  kChangePumpDur,
  kTurnPumpOnForXDur,
  kSelectCUE_ON,
  kTurnCUE_OFF,
  kPrint_States,
  kSendEvent,
  kReset_States,
}

void attachCommandCallbacks(){
  comm.attach(OnUnknownCommand);
  comm.attach(kActivateAllWells,ActivateAllWells);
  comm.attach(kSelectWell_ACT,SelectWell_ACT);
  comm.attach(kSelectWell_DeACT,SelectWell_DeACT);
  comm.attach(kToggleLED,ToggleLED);
  comm.attach(kLED_ON,LED_ON);
  comm.attach(kLED_OFF,LED_OFF);
  comm.attach(kSelectPump_ON,SelectPump_ON);
  comm.attach(kChangePumpDur,ChangePumpDur);
  comm.attach(kTurnPumpOnForXDur,TurnPumpOnForXDur);
  comm.attach(kSelectCUE_ON,SelectCUE_ON);
  comm.attach(kTurnCUE_OFF,TurnCUE_OFF);
  comm.attach(kPrint_States,Print_States);
  comm.attach(kReset_States, Reset_States);
  comm.attach(kSendEvent, SendEvent);
}

void OnUnknownCommand(){
   comm.sendCmd(kError,"Command without attached callback");
}

void SendEvent(char* code, int num){
  comm.sendCmdStart(kAcknowledge);
  comm.sendCmdfArg("%s_%d",code,num);
  comm.sendCmdEnd();
}

/***************************************************
  Setup
