fixed compilation errors in reverseWords