fixed flaw in sorting frequencies.