methods to remove elements from TopologicalSort