implemented "diag"