adding stability terms to element residual, more corrections