def add_to_index(word_index, word, page_url):
    """Add a word to word index and adds a page url to
    the list of urls associated with that word

    Parameters
    -----------
    word_index : dict
        Index of words
    word : str
        Word to be added to the index
    page_url : str
        url to be added in the list of urls associated with "word"

    Returns
    --------
    dict
        Word index with "word" and "page_url" added/updated.

    Notes
    ------
    This function modifies the input dictionary in-situ (in place)
    """
    if word in word_index:
        if page_url in word_index[word]:
            return
        else:
            word_index[word].append(page_url)
            return
    word_index[word] = [page_url]
