code generation works but it looks bad