adding the pagination fields to the index function, updating docs
cleaning up the tables