add quantile-based discretize
sort bug fix