global.js
    * removed unused variables
    * removed deprecated encode() function
    * corrected improper assignment