added pdf routine