debug code - debug error in gadget comparison