   motor3.run(BACKWARD);
   motor4.run(FORWARD);
 
-  delay(250);
-
-  turnMotorsOff();
+  delay(100);
+
+  motorSpeed = currentMotorSpeed;
+
+  if (isMovingForward) {
+    forward(0);
+  } else if (isMovingBackward) {
+    backward(0); 
+  } else {
+    turnMotorsOff();
+  }
 
   return "ok";
 }

  return result;
}

String forward(int speedInP87ercentage)
{
  turnMotorsOn();
  
  motor1.run(BACKWARD);

  }
 
  return result; 
}

void setMotorSpeed(int speedInPercentage) {
  motorSpeed = map(
    speedInPercentage,
    0, 100,
    0, 255
  );
  
  Serial.print(String("Set speed to ") + motorSpeed + " ("+ speedInPercentage +"%)\n");
}


