attempt at using globals

(failed) but will maybe go back to later