Updated how the Jacobian is calculated