path algo work