 }
 
 void doStateNfcKeyLogin() {
-    // wait for the touch and show it
-    if (screen.getTouchScreen().bufferEmpty()) {
-      return;
-    }
-    if (! screen.getTouchScreen().touched()) {
-      return;
-    }
-    
-    
-    // Retrieve a point  
-    TS_Point p = screen.touchscreenGetPoint();
-    /*
+  // wait for the touch and show it
+  if (screen.getTouchScreen().bufferEmpty()) {
+    return;
+  }
+  if (! screen.getTouchScreen().touched()) {
+    return;
+  }
+
+
+  // Retrieve a point  
+  TS_Point p = screen.touchscreenGetPoint();
+  /*
     if (p.z == 0) {
-      return;
-    }
-    */
-
-    // act on touchscreen interaction
-    actOnTouchScreenInteraction(p.x, p.y, true);
+   return;
+   }
+   */
+
+  // act on touchscreen interaction
+  actOnTouchScreenInteraction(p.x, p.y, true);
 }
 
 void doStateNfcCardLogin() {
-    
-    // read the nfc card
-    //uint8_t success;
-    uint8_t uid[] = { 0, 0, 0, 0, 0, 0, 0 };                    // Buffer to store the returned UID
-    uint8_t uidLength = nfclib.initTarget(&*uid);               // Length of the UID (4 or 7 bytes depending on ISO14443A card type)
-    uidLength = nfclib.printTarget();   
-
-    // show the data
-    showDataScreen();
-     
-    // reset everything()
-    reset();  
+
+  // read the nfc card
+  //uint8_t success;
+  uint8_t uid[] = { 
+    0, 0, 0, 0, 0, 0, 0   };                    // Buffer to store the returned UID
+  uint8_t uidLength = nfclib.initTarget(&*uid);               // Length of the UID (4 or 7 bytes depending on ISO14443A card type)
+  uidLength = nfclib.printTarget();   
+
+  // show the data
+  showDataScreen();
+
+  // reset everything()
+  reset();  
 }
 
 void doStateShowData() {
-    // show the data
-    showDataScreen();
-
-    nextState();
+  // show the data
+  showDataScreen();
+
+  nextState();
 }
 
 

{
  // working with the state pattern because we have different screens (states)
  switch (current_state) {
    case STATE_RESET:              doStateReset();              break;
    case STATE_NFC_KEY_LOGIN:      doStateNfcKeyLogin();        break;
    case STATE_NFC_CARD_LOGIN:     doStateNfcCardLogin();       break;
    case STATE_SHOW_DATA:          doStateShowData();           break;
    case STATE_END:                nextState();                 break;
    default:                       doStateReset();              break;
  }

}




/**** display prepare functions ****/

void clearScreen() {
  screen.clearScreen();
}


void reset() {
  // reset all global variables
  current_state = STATE_RESET;
  //  last_key_press_ms = 0;
  //  last_key = 0;
  memset(nfc_key, 0, sizeof(nfc_key));
  nfc_key_count = 0;

  // show the splash screen
  showSplashScreen();

  // reset the sd card controller
  // sd.setup();

  // reset the touchscreen
  uint16_t x, y;
  uint8_t z;  
