better for/range code generation