Added counter loop