     for (int i=0; i<fullspeedsteps; i++) {
         onestep(pulse);
     }
-    for (int i=0; i<accelSteps; i++) {
+    for (int i=0; i<(accelSteps - decelDiff); i++) {
         onestep(map(i, 0, accelSteps, pulse, startstoppulse));
     }
     findsensor(startstoppulse);

    for (int i=0; i<fullspeedsteps; i++) {
        onestep(pulse);
    }
    for (int i=0; i<localAccelSteps; i++) {
        onestep(map(i, 0, localAccelSteps, pulse, maxPulse));
    }
    findsensor(maxPulse);

    for (int i=0; i<glisssteps; i++) {
        onestep(map(i, 0, glisssteps, startpulse, endpulse));
    }
    for (int i=0; i<(accelSteps - (decelDiff * recentre)); i++) {
        onestep(map(i, 0, accelSteps, endpulse, max(maxPulse, endpulse)));
    }
    if (recentre) findsensor(max(maxPulse, endpulse));
