Implemented string reversing functionality