Adding find_paths function that returns a generator.