shuffle and random sample