bool checkWord(String word, String letters) function