learner and sampler works correctly
clean up the code