paging func complete and tested