Multilevel inverter with optimal THD through the firefly algorithm