Enabling a second button with checkboxes

I have successfully enabled a button (access to a grant application) once a series of checkboxes have all been checked (a list of items one needs to apply for the grant). I used this code:
$w.onReady(() => {
$w(‘#checkbox1’).onChange(nextButtonEnableDisable);
$w(‘#checkbox2’).onChange(nextButtonEnableDisable);
$w(‘#checkbox3’).onChange(nextButtonEnableDisable);
$w(‘#checkbox6’).onChange(nextButtonEnableDisable);
$w(‘#checkbox7’).onChange(nextButtonEnableDisable);

}); 

function nextButtonEnableDisable() {
if (($w(‘#checkbox1’).checked && $w(‘#checkbox2’).checked && $w(‘#checkbox3’).checked && $w(‘#checkbox6’).checked) && $w(‘#checkbox7’).checked) {

    $w('#button1').enable(); 
}  **else**  $w('#button1').disable();{ 
} 
} 

On the same page, I have a second button I’d like to enable once a different series of checkboxes have been checked. Everything I have tried (for example, below) to get this second button enabled hasn’t worked, and it has also caused the first “enable button function” to no longer work. I’ve never coded before and I’d really appreciate any help!

$w.onReady(() => {
$w(‘#checkbox1’).onChange(nextButtonEnableDisable);
$w(‘#checkbox2’).onChange(nextButtonEnableDisable);
$w(‘#checkbox3’).onChange(nextButtonEnableDisable);
$w(‘#checkbox6’).onChange(nextButtonEnableDisable);
$w(‘#checkbox7’).onChange(nextButtonEnableDisable);
$w(‘#checkbox4’).onChange(nextButtonEnableDisable2);
$w(‘#checkbox5’).onChange(nextButtonEnableDisable2);
$w(‘#checkbox8’).onChange(nextButtonEnableDisable2);
});

function nextButtonEnableDisable() {
if (($w(‘#checkbox1’).checked && $w(‘#checkbox2’).checked && $w(‘#checkbox3’).checked && $w(‘#checkbox6’).checked) && $w(‘#checkbox7’).checked) {

    $w('#button1').enable(); 
}  **else**  $w('#button1').disable();{ 
} 

function nextButtonEnableDisable2() {
if (($w(‘#checkbox4’).checked && $w(‘#checkbox5’).checked && $w(‘#checkbox8’).checked) {

    $w('#button2').enable(); 
}  **else**  $w('#button2').disable();{ 
}