Changed array_rand to randomElements()