Adding debugging code