Implemented reversing a string