private static String convertToLatex(String function) {
		int i = 0;
		String convertedForm = "";
		while (i < function.length()) {
			if (function.charAt(i) != '*' && function.charAt(i) != '/'
					&& function.charAt(i) != '|' && function.charAt(i) != '^'
					&& function.charAt(i) != '!') {
				convertedForm = convertedForm + function.charAt(i);
				i++;
			} else {

				if (function.charAt(i) == '*') {
					convertedForm = convertedForm + ". ";
					i++;
				}

				if (function.charAt(i) == '/') {
					convertedForm = convertedForm + "\\downarrow ";
					i++;
				}

				if (function.charAt(i) == '|') {
					convertedForm = convertedForm + "\\uparrow  ";
					i++;
				}

				if (function.charAt(i) == '^') {
					convertedForm = convertedForm + "\\oplus  ";
					i++;
				}

				if (function.charAt(i) == '!') {
					if (i == function.length() - 1) {
						convertedForm += "!";
						i++;
					} else {
						if (function.charAt(i + 1) != '(') {
							convertedForm = convertedForm + "\\overline  ";
							i++;
						} else if (function.charAt(i + 1) == '(') {
							convertedForm = convertedForm
									+ "\\overline  {("
									+ convertToLatex(function.substring(i + 2,
											getEndOfBrackets(function, i + 1)))
									+ ")} ";
							i = getEndOfBrackets(function, i + 1) + 1;
						}
					}
				}

			}

		}
		return convertedForm;
	}