 const byte ROWS = 4; //four rows
 const byte COLS = 3; //three columns
 char keys[ROWS][COLS] = {
+  {'7','8','9'},
+  {'4','5','6'},
   {'1','2','3'},
-  {'4','5','6'},
-  {'7','8','9'},
-  {'*','0','#'}
+  {'x','0','P'}
 };
 byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
 byte colPins[COLS] = {8, 7, 6}; //connect to the column pinouts of the keypad

      setState(LOCKED);
    }
  } else if (state == UNLOCKED) {
    char key = keypad.getKey();
    
    if (key) {
      if (key == '#' || key == '*') {
        if (buffer == "0") {
          Serial.println("LOCK;");
          setState(LOCKED);

  resetTimeout();
}

bool checkE() {
 if (analogRead(Epin) < 1000) {
   return true;
 }
 return false;
} 

void callRing() { 
  
  Serial.print("RING;");
  
  lcd.clear();
  lcd.print("Ding     Ding     Ding     Ding     Ding");
  lcd.setCursor(5, 1);
  lcd.print("Dong     Dong     Dong     Dong");
  
  for (int positionCounter = 0; positionCounter < 20; positionCounter++) {
    lcd.scrollDisplayLeft();
    delay(200);
  }
  
  updateDisplay();
}

void setup() {
  lcd.begin(20, 2);
  lcd.print("Booting....");
  delay(500);
  
  Serial.begin(9600);		// Initialize serial communications with the PC
 
  SPI.begin();			// Init SPI bus
  mfrc522.PCD_Init();		// Init MFRC522
  
  updateDisplay();
}


void loop() {
  if (Serial.available() > 0) {
