Reimplemented the onStep event such that it is now held in the events object