modified to understand the new pdf files