move inverter code into separate directory