Wrote getFrequencies method.