def buildEventString(events):
    """
    Function to produce a string representing the event history of a single binary for quick readability.
    IN:
        events (list of tuples): events output from getEventHistory()
    OUT:
        eventString (string): string representing the event history of the binary
    
    MT strings look like: 
        P>S, P<S, or P=S where P is primary type, S is secondary type, 
        and >, < is RLOF (1->2 or 1<-2) or = for CEE

    SN strings look like:
        P*SR for star1 the SN progenitor,or 
        R*SP for star2 the SN progenitor,
        where P is progenitor type, R is remnant type, 
        S is state (I for intact, U for unbound)

    Event strings for the same seed are separated by the undesrcore character ('_')
    """
    
    # Empty event
    if len(events) == 0:
        return 'NA'
    
    eventStr = ''                                                          # event string for this star
    for event in events:
        if event[0] == 'MT':                                               # MT event
            eventStr += str(event[2])                                      # primary stellar type
            eventStr += '=' if event[6] else ('>' if event[4] else '<')    # event type: CEE, RLOF 1->2, RLOF 2->1
            eventStr += str(event[3])                                      # secondary stellar type
        else:                                                              # assume SN event (until other event types are added...)
            eventStr += str(event[2]) if event[4] == 1 else str(event[3])  # Progenitor or Remnant depending upon which star is the SN
            eventStr += '*U' if event[5] else '*I'                         # unbound or intact
            eventStr += str(event[3]) if event[4] == 1 else str(event[2])  # Progenitor or Remnant depending upon which star is the SN 

        eventStr += '_'                                                    # event separator

    return eventStr[:-1]                                                   # return event string for this star (pop the last underscore first)