fixed ordering on values in topo sort