added PCFG functionality (kinda)