adds debugging code