includes a second implementation for reverseString.