BGM and global variables