How to obtain high-quality samples