Added threshold for histogram values