updated to allow checkboxes and checkbox memory