correctness version of Reverse Words in a String