Update residuals.py