finished negativeIndex exercise