sort by num if on same level

by that they get called in the same order as they are defined