Remove unused code, Fix histogram typecast

Histogram works