removed iterate() from count_matches_in_resource