use "lgs" as global object for lgs stuff. Renaming also removes confusion with local and global variable "lgsStateData" being equal