Function createRandomArray