Code cleanup; global.js working