integrated simulation and next_step() logic