edited countoccurences to include noisy data