completed debug code