added second method for reversing a string