public static int[] toSetupPeriods(boolean[] pattern){
		
		int numberOfSetups = 0;
		for (boolean a : pattern){
			if (a) numberOfSetups++;
		}
		int[] setupPeriods = new int[numberOfSetups];
		int pointer = 0;
		for (int t = 0; t < pattern.length; t++){
			if (pattern[t]){
				setupPeriods[pointer] = t;
				pointer++;
			}
		}
		return setupPeriods;
	
	}