Edited codegen

Changed Loop