old_contents: 
  # dfs
  def walk_parents(vertex):
      return [vertex] + sum(
          (walk_parents(parent) for parent in vertex.parents),
          []
      )
  
  def walk_children(vertex):
      return [vertex] + sum(
          (walk_children(child) for child in vertex.children),
          []
      )
  
new_contents: 
  # dfs
  def walk_parents(vertex):
      return sum(
          (walk_parents(parent) for parent in vertex.parents),
          []
      ) + [vertex]
  
  def walk_children(vertex):
      return sum(
          (walk_children(child) for child in vertex.children),
          []
      ) + [vertex]
  
subject: change the dfs algorithm to return proper topological ordering