Changed index1 to index