 }
 
 void loop(){
-	measure();
+  measure();
   Serial.println(arrayToString(measurements,stepsInFullTurn));
-  delay(2000); 
+  delay(1000);
+  stepsToCylinder = findCylinder();
+  for(int i=0; i<stepsToCylinder; i++){
+    rotateStep(counterClockwise);
+  }
+  delay(4000);
 }
 
 // Performs full turn and saves measurements to array

long pingDist;
int  measurements[stepsInFullTurn];
int  noCylinder[stepsInFullTurn];

void setup() {
  // initialize serial communication:

  int lenLargest = 0;
  int iLeftLargest = 0;
  int iRightLargest = 0;
  int nbrOfRightChecks = 0;
  //int startIndex = 0; // TODO This variable was unused
  

  int iLeft;
  int iRight;
