implement simulated motor stepping.
fix bugs in previous commit.