adding a timestep loop