refactored random movement using TimeHandler