Completed code generation a bit more