def get_leftbound(message_type, msg_tow, trigger_tow, msgout, numofmsg):
    """
    Finds the closest leftbound message to the trigger

    Parameters
    ----------
    message_type : list
      names of message type
    msg_tow : list
      TOW values of the corresponding messages
    numofmsg : integer
      Count of the number of messages in the list
    msgout : string
      Name of the message the user wants to analyze
    trigger_tow : int
      TOW value of the trigger being analyzed
    """
    itt = 0
    leftbound = 0
    while itt < numofmsg:
        if msg_tow[itt] < trigger_tow and msg_tow[itt
            ] > leftbound and message_type[itt] == msgout:
            leftbound = msg_tow[itt]
        itt += 1
    return leftbound
