sorting out page length