attempt to fix calculate_frequency in hazard.rb