using topologicalSort from latest bot