loop while counter&gt;0