Make a lot of work

add global vars.