Make method for calculating rankFrequencies and print them to file