diagnostic function define