get_sorted_array now works