reverseString implemented