FOR code generation. Works towards #36