Final Quantile code