refactored the movement functions, and added some randomness when it cannot move where it wants to