Undo inline topo sort

Signed-off-by: Terin Stock <terinjokes@gmail.com>