Ported the stepInTime() function