do_sampling's algorithm has been enhanced.