replaced str-length with count in files