changed all percentile calcs to use R quantile function