fixed error in computing edges in track_dist_changes