I am working with liquid templating, I am wanting to loop through an array, and spit out some HTML that looks like this, 

```
    <div class="classname">
        <div>
          <a>1</a>
          <a>2</a>
          <a>3</a>
          <a>4</a>
          <a>5</a>
          <a>6</a>
        </div>
    </div>
     <div class="classname">
        <div>
          <a>7</a>
          <a>8</a>
          <a>9</a>
          <a>10</a>
          <a>11/a>
          <a>12</a>
        </div>
    </div>
    <div class="classname">
        <div>
          <a>13</a>
          <a>14</a>
          <a>15</a>
          <a>16</a>
          <a>17/a>
          <a>18</a>
        </div>
    </div>

```

So basically for every 6 loops I want open 2 new divs and close the previous 2. I have had a go this is my effort.

```
{% for block in content_blocks %}
            {% assign mod = forloop.index | modulo: 6 %}
              {% if mod / 6 == 1 %}
                <div class="grid-slide">
                    <div>
            {% endif %}
                        <a href="{{block.content_block_url}}" class="location-link">
                            <img src="{{block.content_block_image | url_for_generic_image}}" />
                        </a>
            {% if mod / 6 == 1 %}
                    </div>
                </div>
            {% endif %}
        {% endfor %}

```