protected function renderElements(FieldsetInterface $fieldset)
    {
        $markup = '';
        $elementHelper = $this->getElementHelper();

        $elements = ArrayUtils::iteratorToArray($fieldset, false);
        foreach ($elements as $key => $elementOrFieldset) {
            if ($elementOrFieldset instanceof FieldsetInterface &&
                $fieldset instanceof Collection
            ) {
                $elementOrFieldset->setAttribute('data-counter', $key);
            	$elementOrFieldset->setOption(
            	    'allow_remove',
            	    $key >= $fieldset->getOption('count')
            	       ? $fieldset->allowRemove()
            	       : false
            	);
            }

            $markup .= $elementHelper($elementOrFieldset);
        }

        $this->reset($fieldset);

        return $markup;
    }