   vehiclesNSThread.check();
   vehiclesEWThread.check();
   vehicleRemovalThread.check();
+  signalThread.check();
 
   vehicleEWState = digitalRead(vehicleEW);
   vehicleNSState = digitalRead(vehicleNS);

// Light delays
unsigned long amberLightDelay = 2000; //2sec
unsigned long minimumGreenLight = 20000; //20 sec
unsigned long vehicleTime = 5000; //5s
unsigned long redLightDelay = 3000; //3 sec

int vehicleNSCounter = 0;   // counter for the number of vehicles in NS
int vehicleNSState = 0;        // current state of the vehicleNS button
int lastVehicleNSState = 0;    // previous state of the vehicleNS button

int vehicleEWCounter = 0;   // counter for the number of vehicleNS in EW
int vehicleEWState = 0;        // current state of the vehicleNS button
int lastVehicleEWState = 0;    // previous state of the vehicleNS button

// time since processing started
unsigned long timeSinceStart;

    previousTimeSinceStart = timeSinceStart;
  }
  else {
    //limit printing
    long remainingTime =  (minimumNSGreenLight - (timeSinceStart - previousTimeSinceStart)) / long(1000);
    if (remainingTime % 3 == 0) {      //if waiting for green light
      //if waiting for green light
      Serial.print("Time left for changing EAST WEST to green in : ");
      Serial.print(remainingTime);
      Serial.println("s");
    }
  }
}

void changeEWGreenToAmber() {
  if (timeSinceStart - previousTimeSinceStart > minimumEWGreenLight) {
    Serial.println("Vehicle NORTH-SOUTH direction. Changing signal NORTH-SOUTH to green");

    //change EW to amber
