Trying to fix pagination

Began to make improvements to the pagination