simple code generator, tested for if