working do
optimized path resoving