To reverse an array