first functional path finding