reversestr function works