added line to fix bug with neighboring block-level elements
pass doc as argument to pp method, not as initialize arg