Accessing an array index of -1

Example:

spawn(0, n-1)
....
for(h = 1; h <= logn; h++)
....
B[h][$] = B[h-1][2*$-1] + B[h-1][2*$];

What if $ = 0 ?
Then 2*$ = 0 - 1= -1

Starting from index 1, forgetting to copy the 0th item and extending past the end of the array

Ex.
spawn(1,n){

B[0][$]=A[$];


}