Implement code generation