added sampling option