insertion algorithm modified for checkboxes with the respective selected values