implemented "move" function after getting new direction