mostly finished pdf controller (?)