removed all global-ish vars/functions