step should act on world and the result used with ref, don't use ref as a global variable