improved Frequencies::getFrequency