Still working on topological sort