DG: pdf documentation
PL: OR leftover assumed variables
PL: fixed naked global reference