restructuring to add the inverter