Changes made to reverse method and completed main() to test code