updating jacobian for waves