moved some debug code