Changed Rand to Sample