Removed use of global variables for prependText.