Adding a functional pagination.