Agent takes its course through a Maze - C++