Fixed up count-pairs to handle cycled lists 3.17, solved 3.18