first prototype with code generation