Updated index to include pagination