changed movement logic to take the time to account