edited kernels to support scan over data size