Generalized quantile function. Added quantile-based threshold to highlighting procedure.