added pagination and indexlinks