Remove declaration of counters outside of the loops
contractor: Minor change