 int servoMinAngle = 0;
 int servoMaxAngle = 90;
 int servoStepAngle = (servoMaxAngle-servoMinAngle)/(servoSteps-1);
-int servoMSPerDegree = 5;
+int servoMSPerDegree = 200;
 
-int distanceValues[servoSteps];
+int distanceValues[6];
 
 void setup() {
-  for(int i=0; i<servoSteps; i++){
+  for(int i=0; i<servoSteps; i+=1){
     distanceValues[i] = 0;
   }
   

}

void loop(){
  var i = 0;
  for(servoPos = servoMinAngle; servoPos < servoMaxAngle; servoPos += servoStepAngle){
    execute(servoPos, i);
    i+=1;
  }
  
  for(servoPos = servoMaxAngle; servoPos>servoMinAngle; servoPos-=servoStepAngle)
  {                
    execute(servoPos, i);
    i-=1;
  }
}

void execute(servoPos){
  servo.write(servoPos, i);
  
  triggerSensor();
  int distance = readSensor();
  printDistance(distance);
 
  distanceValues[i] = distance;
  visualizeCircle();
  
  delay(servoMSPerDegree*servoStepAngle);
}

void visualizeCircle() {
  float maxDistance = 50;
  float minDistance = 10;
  
  distance = (distanceValues[0] + distanceValues[1]) / 2;
  
  distance = max(minDistance, distance);
  distance = min(maxDistance, distance);
    
  int height = NUMBER_LEDS/NUMBER_STRIPS - (NUMBER_LEDS/NUMBER_STRIPS * ( (distance - minDistance) / (maxDistance - minDistance) ) );    
  
  int single_strip = NUMBER_PINS / 3;
  
  strip.setBrightness(height * 5);
  
  for(uint16_t i=0; i<single_strip/2; i++) {
    if(i <= height/3 && height/3 != 0){
      for(uint16_t j=0; j < 3; j++) {
          strip.setPixelColor(single_strip/2 + single_strip*j + i, strip.Color(255, 0, 0));
          strip.setPixelColor(single_strip/2 + single_strip*j - i -1, strip.Color(255, 0, 0));
        }
     }
    else{
      for(uint16_t j=0; j < 3; j++) {
          strip.setPixelColor(single_strip/2 + single_strip*j + i, strip.Color(0, 0, 0));
          strip.setPixelColor(single_strip/2 + single_strip*j - i -1, strip.Color(0, 0, 0));
        }
    }    
  }
  strip.show();
} 

void changeColorLinear(int distance){
  float maxDistance = 100;
  float minDistance = 10;

  uint32_t leds[strip.numPixels()];
  
  
  for(int i=0; i<strip.numPixels(); i++){
    int value = min(i*20,255);
    int green = 255-value;
    int red = value;
    leds[i] = strip.Color(red, green, 0);
  }
  
  distance = max(minDistance, distance);
  distance = min(maxDistance, distance);
  
  int height = NUMBER_PINS - (NUMBER_PINS * ( (distance - minDistance) / (maxDistance - minDistance) ) );  

  for(uint16_t i=0; i<strip.numPixels(); i++) {
    if(i <= height){
      strip.setPixelColor(i, leds[i]);
    }
    else{
      strip.setPixelColor(i, strip.Color(0,0,0));
    }    
  }
  
  strip.show();
}

long changeColorAll(int distance){
  int maxDistance = 200;
  int minDistance = 50;
  
  distance = max(minDistance, distance);
  distance = min(maxDistance, distance);

  int value = 255.00 / (maxDistance - minDistance) * (distance - minDistance);
  int green = value;
  int red = 255 - value;

  uint32_t c = strip.Color(red, green, 0);

  for(uint16_t i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, c);
  }
  
  strip.show();
}

long readSensor(){
  // The same pin is used to read the signal from the PING))): a HIGH

  
  // convert the time into a distance
  return microsecondsToCentimeters(duration);
}

void triggerSensor(){
