public function accordion($class, array $sections, $open = 1)
    {
        $html = '';
        $count = 0;
        $id = $this->page->id('accordion');
        foreach ($sections as $head => $body) {
            ++$count;
            $heading = $this->page->id('heading');
            $collapse = $this->page->id('collapse');
            $in = ($open == $count) ? ' in' : '';
            $attributes = array(
                'role' => 'button',
                'data-toggle' => 'collapse',
                'data-parent' => '#'.$id,
                'href' => '#'.$collapse,
                'aria-expanded' => !empty($in) ? 'true' : 'false',
                'aria-controls' => $collapse,
            );
            $begin = strpos($head, '>') + 1;
            $end = strrpos($head, '</');
            $head = substr($head, 0, $begin).$this->page->tag('a', $attributes, substr($head, $begin, $end - $begin)).substr($head, $end);
            $head = substr($this->panel($class, array('head' => $head)), 0, -6); // </div>
            $html .= substr_replace($head, ' role="tab" id="'.$heading.'"', strpos($head, 'class="panel-heading"') + 21, 0);
            $html .= $this->page->tag('div', array(
                    'id' => $collapse,
                    'class' => 'panel-collapse collapse'.$in,
                    'role' => 'tabpanel',
                    'aria-labelledby' => $heading,
                ), strpos($body, 'class="list-group"') ? $body : '<div class="panel-body">'.$body.'</div>');
            $html .= '</div>'; // the one we removed from the $head up top
        }

        return $this->page->tag('div', array(
            'class' => 'panel-group',
            'id' => $id,
            'role' => 'tablist',
            'aria-multiselectable' => 'true',
        ), $html);
    }