added some cheap crappy paging logic