reverse the array