draft of filtering histogram by percentile