sampleEM now used rng as parameter