def delete_name(tally, name, delete_following = False):
    """
    Remove all occurrences of name from any ballot in tally.

    When used to remove undervotes, make sure double undervotes
    have already been handled (since following votes are then
    also eliminated).
    
    Args:
        dictionary {tally}: dictionary mapping ballots to nonnegative reals.
        name (str): name of choice to be eliminated
        delete_following (bool): True if all following positions on ballot
            are also to be eliminated

    Returns:
        dictionary {tally}: dictionary mapping possibly modified ballots 
                            to nonnegative reals.

    Examples:
        >>> tally = {('undervote', 'a'):1, ('undervote', 'undervote', 'b'):1, ('c', 'undervote'):1}
        >>> delete_undervotes(tally)
        {('a',): 1, (): 1, ('c',): 1}
    """

    new_tally  = {}
    for ballot, ballot_tally in tally.items():
        if name in ballot:
            new_ballot = []
            for c in ballot:
                if c != name:
                    new_ballot.append(c)
                elif delete_following:
                    break
            new_ballot = tuple(new_ballot)
        else:
            new_ballot = ballot
        new_tally[new_ballot] = new_tally[new_ballot] +  ballot_tally if new_ballot in new_tally.keys() else ballot_tally
    return new_tally