ppp functions and scripts