one of the percentiles here should be nanpercentile