How Does Topological Sort Work