public static String optimizeText(String text)
	{
		char buf[] = text.toCharArray();
		boolean endMarker = true;	// marks the end of a sentence to make the next char capital
		for(int i = 0; i < buf.length; i++) {
            char c = buf[i];
            if(endMarker && c >= 'a' && c <= 'z') {
				buf[i] -= 0x20;	// transform lower case into upper case
				endMarker = false;
			}
			if(c == '.' || c == '!' || c == '?') endMarker = true;
		}
		return new String(buf, 0, buf.length);
	}