Improved the indexing