def remove_trailing_prefs(proposal_record, preferences):
    """ Function trims each preference list by eliminating possibilities indexed
        after accepted proposal
        Takes in two dictionaries: proposal_record and preference_lists
        Returns updated preference_lists

        For example:
        Inputs of
            proposal_record = {
                'A': ['C', 'B'], - proposed to C and accepted proposal from B
                'B': ['A', 'D'], - proposed to A and accepted proposal from D
                'C': ['D', 'A'], - proposed to D and accepted proposal from A
                'D': ['B', 'C'], - proposed to B and accepted proposal from C
            }
            preferences = {
                'A': ['C', 'B', 'D'], - remove all prefs that rank lower than B
                'B': ['A', 'C', 'D'],
                'C': ['D', 'B', 'A'],
                'D': ['B', 'A', 'C'], - remove 'A' since 'D' is removed from A's list
            }

        Outputs =>
            preferences = {
                'A': ['C', 'B'],
                'B': ['A', 'C', 'D'],
                'C': ['D', 'B', 'A'],
                'D': ['B', 'C'],
            }
    """
    for proposer in proposal_record:
        proposee = proposal_record[proposer][0]
        proposee_prefs = preferences[proposee]
        proposer_ranking = proposee_prefs.index(proposer)

        successors = proposee_prefs[proposer_ranking+1:]

        # Updated proposee's preferences, removing successors
        preferences[proposee] = proposee_prefs[:proposer_ranking+1]

        # Iterate over successors, deleting proposee from own preference list
        for successor in successors:
            if proposee in preferences[successor]:
                preferences[successor].remove(proposee)

    return preferences