rename tsort to topological to prevent issues