Modified stepper motor programme