text is turned into an array for sorting.