sampler for random configurations, and loader of data