Added word reversing code