changed implementation of `step` generator