added paging functionality to the model