added a 'forCount' loop, that will process a list until
either it is empty or a count limit is reached