Adding debug code