Unfinished function to reverse words without creating new array