New randArray function