wrote primitive reverse words in string