IndexToWrite is worong.