Use separate indices for the two ends.