add code supporting --gencode_basic flag