first version of histogramfilter