def getMostFrequent(counts, exclWordList, topNumber):
    """
    This function takes a dictionary of word counts and returns the most 
    frequent ones. The user defines how many of the most frequent words are 
    returned.
    
    INPUT: 
    counts: Dictionary with word counts.
    A list of words to be excluded from consideration
    topNumber: Number of top freqent words to be extracted.
    OUTPUT:
    topFreqWords: Dictionary of top words where keys represent words and values represent number of time a word has been counted.
    """
    sort_words = sorted(counts, key=counts.__getitem__, reverse=True) # Sort words by count
    sort_count = sorted(counts.values(), reverse=True) # Sort counts
    
    
    sort_words = sort_words[:topNumber] # Removing everything except the top words
    sort_count = sort_count[:topNumber]
    
    topCount = {}
    
    for i in range(len(sort_words)):
        topCount[sort_words[i]] = sort_count[i] # Creating dictionary with the top words
    
    return topCount