Rename countOccurrences to numOccurrences