New getPages method