 #include <ZumoReflectanceSensorArray.h>
 #include <Pushbutton.h>
 #include <ZumoMotors.h>
-
 #include <NewServo.h>
 
-#define treshold 1800
 
-ZumoReflectanceSensorArray reflectanceSensors;
+ZumoReflectanceSensorArray reflectanceSensors(QTR_NO_EMITTER_PIN);
 ZumoMotors motors;
 
 double lastDistance = 100;
-
 bool flipServo = false;
 
 unsigned int reflectanceValues[6];

      motors.setSpeeds(0, 0);
    }
    rotateServo(90);
    delay(200);
  }
}

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

  detectLine();
  rotateServoNext();
  detectOpponent(servoPosition, distance);
  killOpponent(servoPosition, distance);
  motors.setSpeeds(0, 0);
}

void detectLine() {
  //reflectanceSensors.read(reflectanceValues);
  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);
  }
  else if (isLineRight(reflectanceValues))
  {
