The hidden beauty of the A* algorithm