Improve flip flops, fix inverter