working on pageNumber function