added more debug info in pgm2