make TopologicalSort an Iterable