histogram better, data being memoized