private static String applyUnification(String sen1, String sen2, String[][] substitution){
		String newSentence = "";
		for(int i = 1; i < substitution.length; i++){
			if(substitution[i][0] != null){
				sen1 = sen1.replaceAll(substitution[i][0], substitution[i][1]);
				sen2 = sen2.replaceAll(substitution[i][0], substitution[i][1]);
			}
		}
		
		//clean up the clauses
		if(sen1.length() < sen2.length()){
			sen2 = sen2.replace(sen1, "");
			sen2 = sen2.replace("&&", "&");
			sen2 = sen2.replace("&|", "|");
			if(sen2.charAt(0) == '&'){
				sen2 = sen2.substring(1,sen2.length());
			}
			if(sen2.charAt(sen2.length() - 1) == '|'){
				sen2 = sen2.substring(0, sen2.length() - 1);
			}
			newSentence = sen2;
		}
		else{
			sen1 = sen1.replace(sen2, "");
			sen1 = sen1.replace("&&", "&");
			sen1 = sen1.replace("&|", "|");
			if(sen1.charAt(0) == '&'){
				sen1 = sen1.substring(1,sen1.length());
			}
			if(sen1.charAt(sen1.length() - 1) == '|'){
				sen1 = sen1.substring(0, sen1.length() - 1);
			}
			newSentence = sen1;
		}
		newSentence = doMath(newSentence);
		return newSentence;
	}