def z_region_pass(region, upper_limit=None, lower_limit=None):
    """return True if extended region [xmin, xmax, ymin, ymax, zmin, zmax] is 
    within upper and lower z limits
    
    Args:
      region (list): a long-region [xmin, xmax, ymin, ymax, zmin, zmax]
      upper_limit (float): the z-max
      lower_limit (float): the z-min
    
    Returns:
      bool: True if region z values are within upper and lower limit
    """
    
    if region is not None:
        z_region = region[4:]
        if z_region is not None and len(z_region) >= 2:
            if upper_limit is not None:
                if z_region[0] >= upper_limit:
                    return(False)
            if lower_limit is not None:
                if z_region[1] <= lower_limit:
                    return(False)
    return(True)