(#497) adding global utiitly function
(#494) taking globals out of spatial