Random array implementation