fix j = i % inst_num