reverse a inputed string