add function to reverse input string