Reverse array function added and tested