Update calculate_frequencies.pl