function which returns desired quantiles of data