function to run PEAR