implement histogram equalization