Update optimization.py