Add the if the button B was clicked block under the if the button A was click. Click on A to select B.
if the button B was clicked
A
B
click on the matrix’s dots to « switch the lights on ». Click again to « turn them off ».