Creating an array of objects with random number of properties