changed index2 to index finally