changed array_sort