- Moved paging code out of loop.