Rewrote the paging functionality. Not quite complete.