Finalized working version of index