Occurrences counting working