Declare loop counter inside