   timer = 0;
   digitalWrite(Green_Led, HIGH);
   digitalWrite(Red_Led, LOW);
+  start_time = millis();
+  vacancyFlag = false;
   authorized = false;
-  start_time = millis();
-  flag = false;
   
   while(!digitalRead(Sensor_Pin)){
-    flag = true;
-    Serial.print("Updating spot vacancy to false...");
-    Serial.println();
-    while(!updateVacancy(false)) {
-      delay(100); // Continuously attempt to update Vacancy if the call fails....
-      start_time = millis();
-    }
-    Serial.print("Pwease Scan an ID Card (^.^)\n");
+    while(millis() - start_time < 3000) { // Wait three seconds to ensure object is still present
+      delay(100);
+    }
+    if(digitalRead(Sensor_Pin)){
+      break;
+    }
+    digitalWrite(Red_Led, HIGH);
+    digitalWrite(Green_Led, LOW);
+    vacancyFlag = true;
+    Serial.println("Vehicle Detected: Updating spot vacancy to false.");    
+    updateVacancy("false");     
+    start_time = millis();
+    
+    Serial.println("Please Scan an ID Card.");
     while( !digitalRead(Sensor_Pin) && readCard() && timer < timeLimit) {
       delay(50);
       timer = millis() - start_time;
-      if(timer > 3000){ // 3 seconds to turn on Red LED
-        digitalWrite(Red_Led, HIGH);
-        digitalWrite(Green_Led, LOW);
-      }
     }
     // If the object left exit the loop
     if(digitalRead(Sensor_Pin))
       break;
-      
-    if(timer > 3000){ // 3 seconds to turn on Red LED
-        digitalWrite(Red_Led, HIGH);
-        digitalWrite(Green_Led, LOW);
-      }    
+
     // If the user timed out
     if(timer > timeLimit) {
-      Serial.print("Uh Oh darling, you ran out of time =(\n");
-      // ****************************************************************
-      //  Just so it can easily be seen...
-      //  Update database of timeOut
-      // ****************************************************************
-      // Kind of an odd workaround...
-      // Logic here is that they either didn't scan a card... or took too long
-      // Thus we send an authorization request with a UID that is guaranteed to not
-      // be valid, this updates the server of an invalid parking at that spot...
-      // At least... that's my thought process...
-//      UID = 0;
-//      authorized = checkAuthorization();
-//    ****** Note.... I'm not even sure this is needed... I highly doubt it but eh...
+      Serial.print("User time has expired...\n");
+      Serial.println("Alerting parking enforcement of unauthorized vehicle.");
+      Serial.println("Please scan a card or leave the spot.");
       
       bool flash = true;
       while(!digitalRead(Sensor_Pin) && readCard()) 


MFRC522 mfrc522(SELECTOR_PIN, RESET_PIN);
MFRC522::MIFARE_Key key;

unsigned int UID = 0;
unsigned long start_time = 0;
unsigned long current_time = 0;
unsigned long timer = 0;
unsigned int timeLimit = 20000;  // Time in milliseconds for sign in

RestClient client = RestClient("6cb06ef3.ngrok.io");
String response;
String path;

bool cardPresent = false;
bool authorized = false;
bool flag;

// List of all the beautiful functions used for this immaculate device
void Wifi_connect();    // Setup code to connect the ESP8266 to the wifi_chip
void get_UID();         // Function to read the data UID from a card
void flash_LED();
bool readCard();        // Convenience Function to read a card
bool cheatAuthorization();  // Cheat function for testing until API is done
bool checkAuthorization();  // Check if the user is authorized
String createPath(String);  // Creates the path for rest calls
bool updateVacancy(bool);    // Update the server of a spot vacancy

void setup() {
  pinMode(Sensor_Pin, INPUT);
  pinMode(Green_Led, OUTPUT);
  pinMode(Red_Led, OUTPUT);
  Serial.begin(9600);
  Wifi_connect();
  SPI.begin();
  // Setup the RFID sensor  
  mfrc522.PCD_Init();           // Initialize the MFRC522 (rfid card)
  // Prepare key - all keys are set to FFFFFFFFFFFFh at chip delivery from the factory.
  for (byte i = 0; i < 6; i++) {
    key.keyByte[i] = 0xFF;    
  }
  
  // Setup the pins for LED 
  pinMode(Green_Led, OUTPUT);
  pinMode(Red_Led, OUTPUT);
  pinMode(Sensor_Pin, INPUT);
  digitalWrite(Green_Led, HIGH);
  digitalWrite(Red_Led, LOW);
}

void loop() {

    UID = UID << 8;
    UID = UID + mfrc522.uid.uidByte[i];
  }
  Serial.print("User has scanned a card with ID: ");
  Serial.println(UID);
  return;
}

// Flashes a designated LED for a specified duration, the LED will always remain
