added a paging algorithm