public static boolean isVowel(String str, int index, int depth) throws java.io.IOException {
        if (index < str.length() && index >= 0) {
            char letter = str.charAt(index);
            if (inList(VOWELS, letter) > -1) {
                return true;
            } else if (letter == 'y') {
                if (depth > MAXYS - 1) throw new java.io.IOException("Too many 'y's. Char " + index); // avoid infinite recursion
                return !isVowel(str, index + 1, depth + 1) && !isVowel(str, index - 1, depth + 1);
            }
        }
        return false;
    }