improve pathfinfing