implement histogram