preparations to generate border distances.