Updated movement timing code.