swapped the current index with index 2