tweaked creating the pdf files