 {
   Serial.begin(57600);
   Serial.setTimeout(25);
-  stepperX.setMaxSpeed(2000);
-  stepperX.setAcceleration(5000);
+  stepperX.setMaxSpeed(3000);
+  stepperX.setAcceleration(4000);
 
 
-  stepperY.setMaxSpeed(2000);
-  stepperY.setAcceleration(5000);
+  stepperY.setMaxSpeed(1000);
+  stepperY.setAcceleration(4000);
 
 
-  Timer1.initialize(50); // microseconds
-  Timer1.attachInterrupt( timerIsr ); // attach the service routine here
-  pinMode(2, INPUT_PULLUP);
-  attachInterrupt(0, setY, FALLING);
+  Timer1.initialize(86);              // Microseconds
+  Timer1.attachInterrupt( timerIsr );  // Attach stepper update function
+  pinMode(2, INPUT_PULLUP);            // Enable pullup resistors for the homing switch
+  attachInterrupt(0, homeXIsr, FALLING);   // Attach homing function
   pinMode(6, OUTPUT);
   pinMode(9, OUTPUT);
 

  stepperY.run();
  stepperX.run();
}
void setY() {
  stepperX.stop();
  stepperX.setCurrentPosition(0);
  homeing = false;
}
void loop()


  if (homeing) {
    enable();
    if (!digitalRead(2)) { // Allready at home position
      stepperX.move(1000); // Move away from home
      }
    if (digitalRead(2)) {  // If not homed
      stepperX.move(-1000);// Move towards home
    }
  }
}

void enable() {
