   }
 }
 
+//initialize motors "moves them to initial position"
 void initialization(){
   int i = 0;
-  while(digitalRead(upLimit) != HIGH){//move up motor to initial place
-    digitalWrite(upPin1, seq[i][0]);
-    digitalWrite(upPin2, seq[i][1]);
-    digitalWrite(upPin3, seq[i][2]);
-    digitalWrite(upPin4, seq[i][3]);
-    delay(upStepperDelay);
-    i++;
-    if(i == 8)
-      i = 0;
-  }
-  stopMotors();
-  //delay(1000);
-  
-  i=0;
-  while(digitalRead(trayLimit) != LOW){//move Tray motor to initial place
-    digitalWrite(roPin1, seq[i][0]);
-    digitalWrite(roPin2, seq[i][1]);
-    digitalWrite(roPin3, seq[i][2]);
-    digitalWrite(roPin4, seq[i][3]);
-    delay(roStepperDelay);
-    i++;
-    if(i == 8)
-      i = 0;
-  }
-  
-  stopMotors();
+  for(int j = 0; j<4; j++){//double check
+    while(digitalRead(upLimit) != HIGH){//move up motor to initial place
+      digitalWrite(upPin1, seq[i][0]);
+      digitalWrite(upPin2, seq[i][1]);
+      digitalWrite(upPin3, seq[i][2]);
+      digitalWrite(upPin4, seq[i][3]);
+      delay(upStepperDelay);
+      i++;
+      if(i == 8)
+        i = 0;
+    }
+    stopMotors();
+    i=0;
+    while(digitalRead(trayLimit) != LOW){//move Tray motor to initial place
+      digitalWrite(roPin1, seq[i][0]);
+      digitalWrite(roPin2, seq[i][1]);
+      digitalWrite(roPin3, seq[i][2]);
+      digitalWrite(roPin4, seq[i][3]);
+      delay(roStepperDelay);
+      i++;
+      if(i == 8)
+        i = 0;
+    }
+    stopMotors();
+  }
 }
 
 void openDoor(){

void getBill(){
  int steps = 0; //for storing steps to return to initial position again
  digitalWrite(pump, HIGH); //activates the pump
  while(/*getCurrent() < currentThreeshold &&*/ steps < maxUpSteps){ //go down until gets one bill
    stepDown(); //move one step down
    steps++;
  }

  //inputs
  pinMode(  infrared,    INPUT);
  pinMode(  doorSwitch,  INPUT);
  pinMode(  temperature, INPUT);
  pinMode(  lightLevel,  INPUT);
  //initialize Serial Communication to communicate with RPI, with Baud rate=9600
