I added ozlem's changes to genereate the PTRIM