Updated to use Globals properly