changed order of arguments to step function, for clarity