removed unneeded global
much better now