debug data generation, made global variable