Using slice() to paginate