ADD implementations of the getAccumulatedFrequencies function