class to store document and logic for paging