changed the MLCG unique_ptr to shared_ptr