adding test case, topological sort