calulate quantiles