added getindex for histograms