added new diagnostic function