* made all the globals local

Signed-off-by: Ession <mail@mathiasjost.com>