renamed sort_array to array_sort