Sort by wait or name