     if (key) {
       if (key == '#' || key == '*') {
         if (buffer == "0") {
-          Serial.print("LOCK;");
+          Serial.println("LOCK;");
           setState(LOCKED);
         }        
       } else {

      }
    }
  } else if (state == WAIT_FOR_UNLOCK) {
    if (Serial.available() > 0) {
      byte incomingByte = Serial.read();
      if (incomingByte == '\n') {
        Serial.println(buffer);
        if (buffer == "ACK;") {
          setState(UNLOCKED);
        } else {
          setState(INVALID_PIN);
        }
      } else {
        buffer += (char)incomingByte;
        resetTimeout();
      }
    } else if (timeoutExpired()) {
      setState(LOCKED);
    }

    Serial.println("state not implemented");
    delay(1000);
  }
}
