added a diagnostic system to examples