Use threshold as a percentile instead of a fraction of overall distance.