          for (var i = 0; i < boxes.length; i++) { // Replaced for...of with traditional for loop
                    var box = boxes[i];
                    if (box.type == 'checkbox') {
                        box.checked = false;
                        // update cookies here too
                        if (box.name.indexOf('[]') !== -1) {
                            updateCookieFromCheckboxGroup(box);
                        } else {
                            updateCookieFromCheckbox(box);
           