changed sampler to accept double values