added function for quantile estimation
roxygenized newly added functions