Diagnostic algorithm