private static String[][] unify(String sen1, String sen2, String[][] currentSub){
		//System.out.println("Unifying " + sen1 + " and " + sen2);
		if(currentSub[0][0] != null && currentSub[0][0].equals("failure")){
			return currentSub;
		}
		else if(sen1.equals(sen2)){
			return currentSub;
		}
		else if(isVariable(sen1)){
			return unifyVariable(sen1,sen2,currentSub);
		}
		else if(isVariable(sen2)){
			return unifyVariable(sen2,sen1,currentSub);
		}
		else if(isCompound(sen1) && isCompound(sen2)){
			return unify(args(sen1), args(sen2), unify(operator(sen1),operator(sen2),currentSub));
		}
		else if(isList(sen1) && isList(sen2)){
			return unify(restArgs(sen1), restArgs(sen2), unify(first(sen1),first(sen2),currentSub));
		}
		else{
			currentSub[0][0] = "failure";
			return currentSub;
		}
	}