parenthesis to remove ambiguity
added export statement
small hack for global variables

(this should be re-thought when the code runs)