Adding more of the pagination code.