Generalized pathfinder: now can take node type