public double evaluate(double[] values) {
		int i = 0;
		for (String s : variablesInOrder) {
			if (s.contains("x")) intStorage[i] = values[0];
			else if (s.contains("y")) intStorage[i] = values[1];
			else if (s.contains("z")) intStorage[i] = values[2];
			else intStorage[i] = Double.parseDouble(s);
			i++;
		}
		for (FunctionOperation fo : operations) {
			switch (fo.operation) {
			case FunctionOperation.ADD:
				intStorage[fo.storageIndex] = intStorage[fo.index1] + intStorage[fo.index2];
				break;
			case FunctionOperation.SUBTRACT:
				intStorage[fo.storageIndex] = intStorage[fo.index1] - intStorage[fo.index2];
				break;
			case FunctionOperation.MULTIPLY:
				intStorage[fo.storageIndex] = intStorage[fo.index1] * intStorage[fo.index2];
				break;
			case FunctionOperation.DIVIDE:
				intStorage[fo.storageIndex] = intStorage[fo.index1] / intStorage[fo.index2];
				break;
			case FunctionOperation.EXPONENT:
				intStorage[fo.storageIndex] = Math.pow(intStorage[fo.index1],intStorage[fo.index2]);
				break;
			case FunctionOperation.SIN:
				intStorage[fo.storageIndex] = Math.sin(intStorage[fo.index1]);
				break;
			case FunctionOperation.SQRT:
				intStorage[fo.storageIndex] = Math.sqrt(intStorage[fo.index1]);
				break;
			case FunctionOperation.COS:
				intStorage[fo.storageIndex] = Math.cos(intStorage[fo.index1]);
				break;
			case FunctionOperation.ACOS:
				intStorage[fo.storageIndex] = Math.acos(intStorage[fo.index1]);
				break;
			case FunctionOperation.ASIN:
				intStorage[fo.storageIndex] = Math.asin(intStorage[fo.index1]);
				break;
			case FunctionOperation.TAN:
				intStorage[fo.storageIndex] = Math.tan(intStorage[fo.index1]);
				break;
			case FunctionOperation.ATAN:
				intStorage[fo.storageIndex] = Math.atan(intStorage[fo.index1]);
				break;
			case FunctionOperation.LN:
				intStorage[fo.storageIndex] = Math.log(intStorage[fo.index1]);
				break;
			case FunctionOperation.TO_RADIANS:
				intStorage[fo.storageIndex] = Math.toRadians(intStorage[fo.index1]);
				break;
			case FunctionOperation.NEGATE:
				intStorage[fo.storageIndex] = -(intStorage[fo.index1]);
				break;
			}
		}
		return intStorage[intStorage.length - 1];

	}