fix page numbering off-by-one
more work towards text layout