#diagnostics routine