recursively lookup path finding