I assumed the checkbox was named "checked".

(bool) is to convert the checkbox value into a boolean. It's not really necessary.