Changed initialisation of class to pass in maxPages.