min_difference.py update