Implement reverse_array()