Adding debug control to print statemens.