javascript hoisting changes, clearer comments