add count_pairs.rb