First stab at adding support for pagebreaks