Ontop of what rkynick said:
Variables, local or global, cannot be put into a package unless in a function. Only functions can be put into packages.
Your function isn't being called correctly, though getWords is already a function.
Proper syntax for a function would be:
function namehere(%all,%local,%vars)
{
...
not function::namehere(%jibberish,"not even local");
...
If statements do not have semicolons at the end.
The only things that have semicolons are:
-Datablocks.
-Packages.
-Objects.
-Calling a function. (ex, function();)
-Separating the for statement ( ex, for([Set the value];[check the value];[change the value]) )
-Setting a value. (ex, %localVar = value;)
Things that do not have a semicolon:
-Functions
-Calling functions within an argument. (ex, function(calledfunction()[No semicolon here]);
-Values within an argument.
-Functions and values within a while, or if statement.
-If
-While
-For (the ending part)
And well, I don't even feel like picking through the rest.