changes to sorted_array