basic code generator now working