def get_run_info_nextseq500( instrument_model, application_version, tree ):
    """
    Helper function to get some info about the sequencing runs.
    Args:
        tree: xml tree 
    Returns:
        dict: basic statistics about run, like date, instrument, number of lanes, flowcell ID, read lengths, etc.
    """
    run_stats = {}

    setup_node = tree.getroot().find("Setup")
    if setup_node is None:
        setup_node = tree.getroot()

    # Get required tree nodes.
    flowcell_node = tree.getroot().find("FlowCellRfidTag")

    # Now actually populate various stats
    run_stats['flow_cell_id'] = flowcell_node.find('SerialNumber').text
    run_stats['date'] = tree.getroot().find('RunStartDate').text
    run_stats['instrument'] = tree.getroot().find('InstrumentID').text
    run_stats['lanes'] = int(setup_node.find('NumLanes').text)
    run_stats['run_id'] = tree.getroot().find('RunID').text    
    run_stats['r1_length'] = int(setup_node.find('Read1').text)
    run_stats['p7_index_length'] = int(setup_node.find('Index1Read').text)

    if( setup_node.find('Read1') != None ):
        run_stats['r2_length'] = int(setup_node.find('Read2').text)
        run_stats['p5_index_length'] = int(setup_node.find('Index2Read').text)
        run_stats['paired_end'] = True
    else:
        run_stats['paired_end'] = False

    run_stats['instrument_type'] = instrument_model
    run_stats['reverse_complement_i5'] = True

    return run_stats