GGM code and debug code for bugfixing issues