revert changes from afternoon and enhance create pgm a tiny bit