Adding diagnostic output