function CombinationExposure_block(myWordClass, myWord, myWordTranslate, animateNoun, animateNounTranslate, inanimateNoun, inanimateNounTranslate, reps, exposure_text, task_type) {

    // myWordClass: ['Number Word', 'Class Word']
    // myWordTranslate: [['one','two'],['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',...];
    console.log(seq_all_trials_in_word_class)

    // ******* 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.length; v++){
            for (var r=0; r<reps; r++){
                if (w==0){ // for number word
                    seq_words_withinWordClass[w][s] = myWordTranslate[w][0]; // always 'One'
                } else {
                    seq_words_withinWordClass[w][s] = myWordTranslate[w][v];
                }
                s+=1;
            }
        }
    }
console.log(seq_words_withinWordClass)

    // seq_words_withinWordClass: [['one','one',...,'one',..,'one','one',...,'one'],['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;
    }


    // ******* construct the trials
    var word_class_name = [];
    var target_name = [];
    var target_name_trnsl = [];
    var noun_name = [];
    var noun_name_trnsl = [];
    var image_name = [];
    for (var t = 0; t < 4; t++) {

        word_class_name[t] = seq_all_trials_in_word_class[t]; // 'Number Word' or 'Class Word'
        var wordClassID = myWordClass.indexOf(word_class_name[t]); // 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 
        target_name_trnsl[t] = 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 targetID = myWordTranslate[wordClassID].indexOf(target_name_trnsl[t]); // 0 for word_name_trnsl=='two' or 'animate'; 1 for word_name_trnsl=='animate' or 'inanimate'
        target_name[t] = myWord[wordClassID][targetID] // artificial words for word_name_trnsl

        // randomly choose the nouns
        var seq = range(0,100).slice(0, animateNounTranslate.length);
        seq = shuffle(seq);
        var animate_noun_trnsl = [animateNounTranslate[seq[0]],animateNounTranslate[seq[1]]];
        var inanimate_noun_trnsl = [inanimateNounTranslate[seq[0]],inanimateNounTranslate[seq[1]]];
        var orientation = shuffle(['','']);
        orientation = orientation[0];
        // if the word class is Num (e.g., the word_name_trnsl=='two'), then choose an animate/inanimate paired with Num
        // if the word class is Cl, then choose the corresponding noun (animate/inanimate) with Num of One
        if (word_class_name[t]=='Number Word'){ // if 'Number Word'
            var animate_or_inanimate = shuffle([1,2]);
            if (animate_or_inanimate[0]==1) {
                noun_name_trnsl[t] = animate_noun_trnsl[0];
                noun_name[t] = animateNoun[animateNounTranslate.indexOf(noun_name_trnsl[t])];
            } else {
                noun_name_trnsl[t] = inanimate_noun_trnsl[0];
                noun_name[t] = inanimateNoun[inanimateNounTranslate.indexOf(noun_name_trnsl[t])];
            }
            image_name[t] = target_name_trnsl[t]+' '+noun_name_trnsl[t];
        } else { // if 'Cl Word'
            if (target_name_trnsl[t]=='animate') { // if animate
               noun_name_trnsl[t] = animate_noun_trnsl[0];
               noun_name[t] = animateNoun[animateNounTranslate.indexOf(noun_name_trnsl[t])];
            } else { // if inanimate
               noun_name_trnsl[t] = inanimate_noun_trnsl[0];
               noun_name[t] = inanimateNoun[inanimateNounTranslate.indexOf(noun_name_trnsl[t])];
            }
            image_name[t] = noun_name_trnsl[t];
        }

        console.log([noun_name_trnsl[t],target_name_trnsl[t]])
        
        // assign images
        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[t]+orientation+'.jpg" class="Cntr0" >';
        
        // assign texts
        var word_name_text = '<div class="top2"><strong>'+noun_name[t]+' '+target_name[t]+'</strong></div>';
        var instruction_text = exposure_text;
        var wordname_instr_text = word_name_text + instruction_text;

        exposure_trials.push({trl_num:t+1, trl_num_wrdclss:trl_num_currWordClass, wrd_clss:word_class_name[t], 
            target:target_name[t], target_trnsl:target_name_trnsl[t], noun:noun_name[t], noun_trnsl:noun_name_trnsl[t],
            img_name:image_name[t], img:image, img_blank:image_blank, ortt:orientation, 
            wordname_txt:word_name_text, wordname_instr_txt:wordname_instr_text});
    }

	// for save csv
	var csv_header = ['','trial_overall','trial_wordClass','wordClass','exposure_word','Translate',
        'Noun','NounTranslate','orientation','saveTime\n'];
	var data_to_save = csv_header;
	//console.log(csv_header)
    //// ******************* trial setup according to the randomised pairing *****************************
    var show_word_text = {
        type: 'html-keyboard-response',
        choices: jsPsych.NO_KEYS,
        stimulus: jsPsych.timelineVariable('wordname_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('wordname_txt'),
        response_ends_trial: false,
        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 targetName = jsPsych.timelineVariable('target',true);
			 	           var targetNameTranslate = jsPsych.timelineVariable('target_trnsl',true);
                           var nounName = jsPsych.timelineVariable('noun',true);
                           var nounNameTranslate = jsPsych.timelineVariable('noun_trnsl',true);
			 	           var orient = jsPsych.timelineVariable('ortt',true);
				           if (orient==''){orient='NA'};
			 	           var time = getTime();
				           var data_snglTrl = [trl_num_overall, trl_num_wordclass, wordClass, targetName, targetNameTranslate, 
                            nounName, nounNameTranslate, orient, 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('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('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_text,
			show_image,
			show_instruction_hold_press,
			press_to_continue,
			blank_page
        ],
        // add the trials as a variable
        timeline_variables: exposure_trials,
    };
 
 var exposure_output = [exposure_trial, word_class_name, target_name, target_name_trnsl, noun_name, noun_name_trnsl, image_name];

 return exposure_output

}