Added goal detection to maze.
Added goal detecting for pyramid task.