Changed functions to variables

Unnecessary functions like getText() and numWords() were changed to variables text and numWords. Also added comments.