modified CFG and parser