def getWords(filename, length=None):
    """
        Returns all the words of a given length from the given global dictionary file
    """

    with open(filename) as f:
        l = []
        for words in f:
            word = words.strip().lower()
            if (length is None) or (length is not None and len(word) == length):
                l.append(word)
    return l