function NumClExposure_block(myWordClass, myWord, myWordTranslate, animateNounTranslate, inanimateNounTranslate, reps, exposure_text, task_type) {

    // myWordClass: ['Number Word', 'Class Word']
    // myWordTranslate: [['two','three'],['animate','inanimate']]
    // exposure_text: ['exposure text for Num','exposure text for Cl']
    // reps: repetitions for each of the four words (not each word class), so repetitions for each word class is 2*reps 
	var exposure_trials = [];
    
    // ******* create sequence of word classes
    var seq_all_trials_in_word_class = [];
    var s = 0;    
    for (var w=0; w<myWordClass.length; w++){
        for (var r=0; r<2*reps; r++){
            seq_all_trials_in_word_class[s] = myWordClass[w];
            s+=1;
        }
    }
    // seq_all_trials_in_word_class: ['Number Word','Number Word','Number Word',...,'Number Word','Class Word','Class Word','Class Word',...,'Class Word'];
    
    var total_number_of_trials = seq_all_trials_in_word_class.length;
    // randomise sequence
	var if_consecutive_items = true;
    var max_num_consecutive_items = 2;
    while (if_consecutive_items == true){
        seq_all_trials_in_word_class = shuffle(seq_all_trials_in_word_class);
        if_consecutive_items = if_consecutive(seq_all_trials_in_word_class, max_num_consecutive_items+1);		
        // ensure that a same word class does not present more than twice consecutively
    };
    // e.g., seq_all_trials_in_word_class: ['Class Word','Number Word','Number Word','Class Word','Class Word','Number Word','Class Word','Class Word','Number Word',...];

    // ******* create sequence of words for each word class
    var seq_words_withinWordClass = [];
    for (var w=0; w<myWordClass.length; w++){
        seq_words_withinWordClass[w] = [];
        var s = 0;
        for (var v=0; v<myWordTranslate[w].length; v++){
            for (var r=0; r<reps; r++){
                seq_words_withinWordClass[w][s] = myWordTranslate[w][v];
                s+=1;
            }
        }
    }
    
    // seq_words_withinWordClass: [['two','two',...,'two',..,'three','three',...,'three'],['animate','animate',...,'animate','inanimate','inanimate',...,'inanimate']]
    // shuffle this sequence
    var max_num_consecutive_items = 2;
    for (var w=0; w<myWordClass.length; w++){
        var if_consecutive_items = true;
        while (if_consecutive_items == true){
            seq_words_withinWordClass[w] = shuffle(seq_words_withinWordClass[w]);
            if_consecutive_items = if_consecutive(seq_words_withinWordClass[w], max_num_consecutive_items+1);		
            // ensure that a same word does not present more than twice consecutively within a word class
        }
    };

    // ******* initiate trial number for each word class
    var trl_num_currWrdClss = [];
    for (var w=0; w<myWordClass.length; w++){
        trl_num_currWrdClss[w] = 1;
    }

    console.log(seq_all_trials_in_word_class)
    console.log(seq_words_withinWordClass)
    // ******* construct the trials
    for (var t = 0; t < total_number_of_trials; t++) {

        var word_class_name = seq_all_trials_in_word_class[t]; // 'Number Word' or 'Class Word'
        var wordClassID = myWordClass.indexOf(word_class_name); // 0 if word_class_name=='Number Word'; 1 if word_class_name=='Class Word'
        var trl_num_currWordClass = trl_num_currWrdClss[wordClassID]; // the trial number for the current word class (initial value is 0 and are added up by 1 every loop)
        trl_num_currWrdClss[wordClassID] += 1; // add 1 for trial number for each word class per loop 
        var word_name_trnsl = seq_words_withinWordClass[wordClassID][trl_num_currWordClass-1]; // 'two' or 'three' if word_class_name=='Number Word'; 'animate' or 'inanimate' if word_class_name=='Cl Word'        
        var myWordID = myWordTranslate[wordClassID].indexOf(word_name_trnsl); // 0 for word_name_trnsl=='two' or 'animate'; 1 for word_name_trnsl=='animate' or 'inanimate'
        var word_name = myWord[wordClassID][myWordID] // artificial words for word_name_trnsl
        
        // randomly choose the nouns
        var animate_noun_trnsl = shuffle(animateNounTranslate);
        var inanimate_noun_trnsl = shuffle(inanimateNounTranslate);
        var orientation = shuffle(['','']);
        orientation = orientation[0];
        // if the word class is Num (e.g., the word_name_trnsl=='two'), then choose an animate noun and an inanimate noun
        // if the word class is Cl, then choose two animate/inanimate nouns consistent with the word class name but with different Num words 
        var image_name = [];
        if (word_class_name=='Number Word'){ // if 'Number Word'
            image_name[0] = word_name_trnsl+' '+animate_noun_trnsl[0];
            image_name[1] = word_name_trnsl+' '+inanimate_noun_trnsl[0];
        } else { // if 'Cl Word'
            var num_name_trnsl = myWordTranslate[myWordClass.indexOf('Number Word')];
            if (word_name_trnsl=='animate') { // if animate
               image_name[0] = num_name_trnsl[0]+' '+animate_noun_trnsl[0];
               image_name[1] = num_name_trnsl[1]+' '+animate_noun_trnsl[1];
            } else { // if inanimate
               image_name[0] = num_name_trnsl[0]+' '+inanimate_noun_trnsl[0];
               image_name[1] = num_name_trnsl[1]+' '+inanimate_noun_trnsl[1];
            }       
        } 
        image_name = shuffle(image_name); // shuffle image_name
        console.log(word_name_trnsl)

        // assign images
        var imagePos = ['Left','Right'];
        var image_blank = '<img src="'+img_path+"empty_image.png"+'" class="Cntr0" >';
        var image = [];
        image[0] = image_blank;
        image[1] = '<img src="'+img_path+image_name[0]+orientation+'.jpg" class="'+imagePos[0]+'" >';
        image[2] = '<img src="'+img_path+image_name[1]+orientation+'.jpg" class="'+imagePos[1]+'" >';
        
        // assign texts
        var word_class_name_text = '<div class="top1"><strong>'+word_class_name+':</strong></div>';
        var word_name_text = '<div class="top2"><strong>'+word_name_trnsl+'</strong></div>';
        var instruction_text = exposure_text[wordClassID];
        var wordclass_wordname_text = word_class_name_text + word_name_text;
        var wordclass_wordname_instr_text = wordclass_wordname_text + instruction_text;

        exposure_trials.push({trl_num:t+1, trl_num_wrdclss:trl_num_currWordClass, wrd_clss:word_class_name, 
            wrd:word_name, wrd_trnsl:word_name_trnsl, img_name1:image_name[0], img_name2:image_name[1], img:image, 
            img_pos1:imagePos[0], img_pos2:imagePos[1], img_blank:image_blank, ortt:orientation, wordclass_txt:word_class_name_text, 
            wordclass_wordname_txt:wordclass_wordname_text, wordclass_wordname_instr_txt:wordclass_wordname_instr_text});
    }

	// for save csv
	var csv_header = ['','trial_overall','trial_wordClass','wordClass','exposure_word','Translate','orientation',
        'image1','image_position1','image2','image_position2','saveTime\n'];
	var data_to_save = csv_header;
	//console.log(csv_header)
    //// ******************* trial setup according to the randomised pairing *****************************
    var show_word_class_text = {
        type: 'html-keyboard-response',
        choices: jsPsych.NO_KEYS,
        stimulus: jsPsych.timelineVariable('wordclass_txt'),
        trial_duration: 800
    };
    
    var show_image = {
        type: 'html-keyboard-response',
        stimulus: jsPsych.timelineVariable('img'), // calls image stimuli
        choices: jsPsych.NO_KEYS,
        prompt: jsPsych.timelineVariable('wordclass_txt'),
        response_ends_trial: false,
        trial_duration: 800
    };
    
	 // then show the target word, at the same time display audio
	var show_word_text = {
        type: 'html-keyboard-response',
        stimulus: jsPsych.timelineVariable('img'),
		choices: jsPsych.NO_KEYS,
        prompt: jsPsych.timelineVariable('wordclass_wordname_txt'),
        response_ends_trial: false, //prevents response from ending trial
		trial_duration: 800
    };

	var show_instruction_hold_press = {
		// audio exposure trial with associated image displayed as button
		type: 'html-keyboard-response',
		stimulus: jsPsych.timelineVariable('img'),
		choices: jsPsych.NO_KEYS,
		prompt: function(){
	  			           // ----------------------------- SAVE DATA (csv)------------------------------------
		 	 	           var trl_num_overall = jsPsych.timelineVariable('trl_num',true);
                           var trl_num_wordclass = jsPsych.timelineVariable('trl_num_wrdclss',true);
                           var wordClass = jsPsych.timelineVariable('wrd_clss',true);
			 	           var wordName = jsPsych.timelineVariable('wrd',true);
			 	           var wordNameTranslate = jsPsych.timelineVariable('wrd_trnsl',true);
                           var imageName1 = jsPsych.timelineVariable('img_name1',true);
                           var imageName2 = jsPsych.timelineVariable('img_name2',true);
                           var imagePosition1 = jsPsych.timelineVariable('img_pos1',true);
                           var imagePosition2 = jsPsych.timelineVariable('img_pos2',true);
			 	           var orient = jsPsych.timelineVariable('ortt',true);
				           if (orient==''){orient='NA'};
			 	           var time = getTime();
				           var data_snglTrl = [trl_num_overall, trl_num_wordclass, wordClass, wordName, wordNameTranslate, orient, 
                            imageName1, imagePosition1, imageName2, imagePosition2, time+'\n'];
				           data_to_save = data_to_save.concat(data_snglTrl);
				           var data_to_save_string = data_to_save.toString();
						   var csvName = window.saveFileNameHeader+'_'+task_type+'.csv';
				           saveData(csvName,data_to_save_string);
				           return jsPsych.timelineVariable('wordclass_wordname_instr_txt',true)
				         },
		response_ends_trial: false, //prevents response from ending trial
		trial_duration: 500
	    };

	var press_to_continue = {
        // keeps displaying image until participant presses spacebar
        type: 'html-keyboard-response',
        stimulus: jsPsych.timelineVariable('img'), // calls image stimuli
        choices: [32], // only allows progression using spacebar
		prompt: jsPsych.timelineVariable('wordclass_wordname_instr_txt')
        };

	var blank_page = {
		type: 'html-keyboard-response',
		choices: jsPsych.NO_KEYS,
		stimulus: jsPsych.timelineVariable('img_blank'),
		trial_duration: 100
	    };
			// put them together
	var exposure_trial = {
        timeline: [
            show_word_class_text,
			show_image,
			show_word_text,
			show_instruction_hold_press,
			press_to_continue,
			blank_page
        ],
        // add the trials as a variable
        timeline_variables: exposure_trials,
    };
 
 return exposure_trial

}