adapted sample to checkbox