Simplified and probably sped up random-sample.