Updating with Diana's changes to PF code