preprocess for the space, then normal reverse the whole string and then each word