improved the indexing