ADD: residual accessor function

added residual accessor function for better diagnostics