path finder, first implementation