update getDensity to use new histogram()