Improvement on searching paths