Accelstepper function

Ok thanks. Very elegant code.