added midpoint interpolation to percentile