fixed some bugs.

cleaned up the schedulestep code.