change code in sorted_data.py