added loop to count archives