Separate implementation of MLSampling

Fixes an item in #47.