Implement histogram