combine sampling logic