Added the core of the indexing.