DIAGNOSTIC FUNCTION