improving getPageHeight