added the two functions for pp2