patched to handle new pf file format with generality to old format.