def span(boundaries, from_grid_unit, to_grid_unit):
    """Returns the distance between two grid_unit"""
    assert to_grid_unit >= from_grid_unit > 0, "Grid unit number out of range"
    return boundaries[to_grid_unit] - boundaries[from_grid_unit - 1]