Reorders by dependencies