Added input and deleted the separate class for topological sorting