Toplogical sort order
CPS style