Be cleverer about finding the path