Finished draft of paging implementation