Updating distances to use view of two sets as a union to saw memory and
improve speed