     currentState[direction_pin] = LOW;
     digitalWrite(direction_pin,LOW);
   }
-  
-    //Update currentPosition
+
+  //Update currentPosition
   if (currentState[direction_pin] == HIGH){
     currentPosition[pin]--;
   } 
   else {
     currentPosition[pin]++;
   }
-  
+
   //Pulse the control pin
   digitalWrite(pin,currentState[pin]);
   currentState[pin] = ~currentState[pin];



void loop(){
  
  //The first loop, reset all the drives, and wait 2 seconds...
  if (firstRun)
  {

      currentTick[16]=0;
    }
  }

}

void togglePin(byte pin, byte direction_pin) {

  //Switch directions if end has been reached
  if (currentPosition[pin] >= MAX_POSITION[pin]) {
    currentState[direction_pin] = HIGH;
