             Serial.println(inputString);
         }
 
-        // clear the string:
-        inputString = "";
-        stringComplete = false;
+        clearInputString();
     }
 }

    max1464.begin();
}

void serialEvent() {
    while (Serial.available()) {
        char inChar = (char)Serial.read();

                    Serial.println();
                }
            }
            clearInputString();
            return;
        }

        inputString.toUpperCase();
        inputString = strtok((char *)inputString.c_str(), " ");

        if(String("IDEN").startsWith(inputString)) {
            printIden();
        }
        else if(String("RFW").startsWith(inputString)) {
