Adding diagnostic code