added codegen for record types