made changes to random_samples() used random_sample_n