An improvement for random values from an array