 // IIIb. Tap Logic Functions
 
 void checkIsTap()
-{ 
-  if(flashCount > 0)
-    return;
-    
-  if( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) )
-    isRightTap = true;
-  else if( (digitalRead(LEFT_SIGNAL_INPUT) == 1) )
-    isLeftTap = true;
+{   
+  if(flashCount > 0)  
+  {    
+    if( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) )    
+    {      
+      isRightTap = false;      
+      resetFlashCount();    
+    }    
+    else if( (digitalRead(LEFT_SIGNAL_INPUT) == 0) )    
+    {      
+      isLeftTap = false;      
+      resetFlashCount();    
+    }  
+  }  
+  else  
+  {      
+    if( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) )      
+      isRightTap = true;    
+    else if( (digitalRead(LEFT_SIGNAL_INPUT) == 0) )      
+      isLeftTap = true;  
+  }
 }
 
 void updateTapControl()
-{
-  flashCount++;
-    
-  if( (flashCount > MAX_REPEAT_ON_TAP) and (isRightTap) )
-  {
-    isRightTap = false;
+{  
+  flashCount++;      
+  if( (flashCount > MAX_REPEAT_ON_TAP) and (isRightTap) )  
+  {    
+    isRightTap = false;    
+    resetFlashCount();  
+  }  
+  else if( (flashCount > MAX_REPEAT_ON_TAP) and (isLeftTap) )  
+  {    
+    isLeftTap = false;    
+    resetFlashCount();  
   }
-  else if( (flashCount > MAX_REPEAT_ON_TAP) and (isLeftTap) )
-  {
-    isLeftTap = false;
-  }
 }
 
 void resetFlashCount()

  else
  {
    // 5. This is if the right turn signal is on, do a cycle through the lights.
    if( ( (digitalRead(LEFT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1) ) and ( (digitalRead(RIGHT_SIGNAL_INPUT) == 0) || (!isRightTap) ) )
    {
      (digitalRead(MODE_INPUT) == 0) ? (rightSequence(QUICK_BLINK, QUICK_BLINK)) : (rightBlink(SLOW_BLINK, MEDIUM_BLINK));
    }
    
    // 6. Here is if the left turn signal is on. Cycle through the lights.
    if( ( (digitalRead(RIGHT_SIGNAL_INPUT) == 1) and (digitalRead(BRAKE_INPUT) == 1) ) and ( (digitalRead(LEFT_SIGNAL_INPUT) == 0) || (!isLeftTap) ) )
    {
      (digitalRead(MODE_INPUT) == 0) ? (leftSequence(QUICK_BLINK, QUICK_BLINK)) : (leftBlink(SLOW_BLINK, MEDIUM_BLINK));
    }


void leftSequence(int durationMillis, int pauseDurationMillis)
{
  checkIsTap();
  
  selectLeftOn(ON, OFF, OFF, OFF);
  selectRightOn(OFF, OFF, OFF, OFF);
  delay(durationMillis);
