public static void createTrials() throws IncorrectNumberOfTrialsException {
    	if (Experiment.pp == null) {
    		System.err.println("Cannot create trials before participant is defined!");
    	} else {
    		int ssOffset = Experiment.pp.ssNb % CONDITION_MATRIX.length; //1 to 2
    		if (ssOffset == 0) {
    			ssOffset = CONDITION_MATRIX.length;
    		}

    		//create all trials, in 8 groups of 40 (one group per condition)
    		List<Trial> lowLoadTrials = new ArrayList<Trial>();
    		List<Trial> highLoadTrials = new ArrayList<Trial>();

    		while (!IO.stimStrings.isEmpty()) {
    			String[] trialLine = IO.stimStrings.remove(0); //the line containing the text of this trial    		
    			String cue = trialLine[0];
    			int list = Integer.parseInt(trialLine[1]);
    			    			
    			boolean[] condition = CONDITION_MATRIX[(ssOffset - 1) % CONDITION_MATRIX.length]; //-1 because ssOffset starts at 1, while conditionMatrix starts at 0
    			boolean list1lowload = condition[0];

    			boolean lowLoad = ((list == 1 && list1lowload) || (list == 2 && !list1lowload));
    			
    			Trial t = new Trial(cue, lowLoad, false, list);
    			
    			if	(lowLoad) {
    				lowLoadTrials.add(t);
    			} else {
    				highLoadTrials.add(t);  			
    			}
    		}
    		    		
    		//randomize the order within each list
    		Collections.shuffle(lowLoadTrials);
    		Collections.shuffle(highLoadTrials);

    		experimentTrialGroups = new ArrayList<TrialGroup>();
    		experimentTrialGroups.addAll(TrialGroup.createTrialGroups(lowLoadTrials));
    		experimentTrialGroups.addAll(TrialGroup.createTrialGroups(highLoadTrials));   		
    		Collections.shuffle(experimentTrialGroups);    		
    	}
    }