     delay(REVERSE_DURATION);
     motors.setSpeeds(-TURN_SPEED, TURN_SPEED);
     delay(TURN_DURATION);
-    motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);
   }
 }
 

void loop() {
  int distance = getDistance();

  Serial.println(servoPin);
  detectLine(reflectanceValues);
  rotateServoNext();
  killOpponent(servoPosition, distance);
  detectLine(reflectanceValues);
  rotateServoNext();
  detectOpponent(servoPosition, distance);
  detectLine(reflectanceValues);
  motors.setSpeeds(0, 0);
}

void detectLine(int reflectanceValues[]) {
  reflectanceSensors.read(reflectanceValues);
  Serial.println(reflectanceValues[1]);
  Serial.println(reflectanceValues[4]);
  if (isLineLeft(reflectanceValues)) {
    // if leftmost sensor detects line, reverse and turn to the right
    motors.setSpeeds(-REVERSE_SPEED, -REVERSE_SPEED);
    delay(REVERSE_DURATION);
    motors.setSpeeds(TURN_SPEED, -TURN_SPEED);
    delay(TURN_DURATION);
    motors.setSpeeds(FORWARD_SPEED, FORWARD_SPEED);
  }
  else if (isLineRight(reflectanceValues))
  {

}

void detectOpponent(int positionServo, double distance) {
  if (distance < 20) {
    if (positionServo > 90) {
      // turn left
