adding main in Sampling for testing purposes