Changed quantile function in flagging procedure