FYI, this object relies on a global variable having been defined (G). Previously you passed it in. I left it as is for now.