public static String toProperCase(String s) {
		if (s.isEmpty())
			return "";
		String[] unimportant = new String[] { "a", "an", "and", "but", "is",
				"are", "for", "nor", "of", "or", "so", "the", "to", "yet" };
		String[] split = s.split("\\s+");
		String result = "";
		for (int i = 0; i < split.length; i++) {
			String word = split[i];
			boolean capitalize = true;
			for (String str : unimportant) {
				if (str.equalsIgnoreCase(word)) {
					if (i > 0 && i < split.length - 1) { //middle unimportant word
						capitalize = false;
						break;
					}
				}
			}
			if (capitalize)
				result += capitalize(word) + " ";
			else
				result += word.toLowerCase() + " ";
		}
		return result.trim();
	}