added PGM to main app and small change in kmean