Added code to handle checkboxes.