improved CreateSparseRandomArray function to also generate negative numbers