removed non-functional topological sort - going into redesign stage