let it not to declare variables into the global

let it not to declare variables into the global

what i did was:
pack whole code with a anonymous function and call it.