added method to reverse string