not sure but first use of i and i+1 might overrun.