 bool Well_Active_State[nWells]; // state variable indicating active well
 bool Pump_State[nWells]; // Pump: on/off
 // TTL State Variables
-bool TTL_IR_Detect[nWells]; // TTL PULSE indicating that there was a detection.
-bool TTL_RD; // TTL PULSE indicating if a reward was delivered.
+bool TTL_IR_Detect_State[nWells]; // TTL PULSE indicating that there was a detection.
 
 /******************************************
         Time references

    Well_IR_State[well] = false;
    Well_Detect_State[well] = false;
    ResetDetectTimer(well);
  }
}



void Deliver_Reward(int well) {
  TurnOnPump(well);
}

void TurnOnPump(int well) {
  // set pump to on & set pump timer
  digitalWrite(Pumps_Pins[well], Pump_ON);
  digitalWrite(TTL_RD_Pin,HIGH);
  Pump_State[well] = true;
  PumpTimeRef[well] = millis();
  PumpTimer[well] = 0;
