save/load multiple checkbox state

i havent tried this but this may work. Make a function which takes in the button reference and then save the reference to map with the state and save the map. and for retrieving the state make a function that takes the button reference and then just get the state.