Added simpler version of create_pfiles