added the pdf function