for Bret
added connections from residuals to states in deriv graph