Add topo sort