Update dynamics.py