corrected indexing