Improved the pagebreak algorithm.