added debug code.