added checkbox logic, might be broked though