Add 'frequencies' function