def intervals_between(grid, start, end, speaker=None, tier=None):
    """
    Data frame of intervals between timepoints (inclusive) 
    for all speakers or specified speaker, on all tiers or 
    specified tier
    grid (dataframe)
    start (float): start time (s)
    end (float): end time (s)
    speaker (str): speaker name
    tier (str): tier name
    """
    if speaker is not None:
        grid = grid[(grid['speaker'] == speaker)]
    if tier is not None:
        grid = grid[(grid['tier'] == tier)]
    intervals = grid[((grid['start'] >= start) & (grid['end'] <= end))]
    intervals = intervals.reset_index(drop=True)
    return intervals