min_difference.py updated