Added time_step function, untested