implemented arithmetic code generation