done reverse method for array