sort tasks by level