main code stored here to control inverter