Code generation mostly implemented.