We need to -1 here so the end of the loop makes it 0.