diagnostics function

Generic Diagnostics Function