same as above, too many global() calls