added index_reg_gen