processing for data, distance calculations