Fixed gadget sorting