Replacing with provided index