Updating code changing new Array for []