process the distance data