corrected and implemented Histogram with threshold bar