   }
 
   if (safetyDriveMode) {
+
+    // set the interval for measuring distance
     int checkDistanceInterval = map(
       motorSpeed,
       0, maxMotorSpeed,
-      500, 100
+      400, 50 // in milliseconds
     );
     
     int distanceToStop = map(
       motorSpeed,
       0, maxMotorSpeed,
-      15, 60
+      15, 60 // in centimeter
     );
     
     runEvery(checkDistanceInterval) {

  servo.write(180);
  delay(500);
  servo.write(90);
  
  delay(350);
  
  servo.detach();

  
  String command = getCommandFromInput(input);
  int argument = getArgumentFromInput(input);

  // yes, a switch-case-construct would be better, but its not supporting strings as case value.. only integers
  if(command == "battery") {
    result = checkBatteryStatus(argument);
  } else if(command == "distance") {
