reversing an array using recursion