moved count() out of the for loop