Sampling script (four kernels)